
umask
で見つけることができる設定/etc/profile
とcmask
で見つけることができる設定の違いは何ですか/etc/default/init
?
2つの違いは何ですか?一方が他のものよりもいつ効力を発揮するのでしょうか。
答え1
マンページではinit
内容を説明し、/etc/default/init
次のように言います。
CMASK The mask (see umask(1)) that init uses and that every
process inherits from the init process. If not set,
init uses the mask it inherits from the kernel. Note that
init always attempts to apply a umask of 022 before creating
a file, regardless of the setting of CMASK
init
コアサービスコンポーネントとプロセスを開始または再起動するため、CMASKはこれらのコンポーネントに影響を与え、init
特に新しいディレクトリを作成するデーモンはこのCMASK値をumask
。
umask
/etc/profile
独自のドットファイルで上書きされない限り、ログインしたユーザーに設定が適用されます。