cmask 和 umask 有什么区别?

cmask 和 umask 有什么区别?

umask可以在 中找到的设置/etc/profilecmask可以在 中找到的设置有什么区别/etc/default/init

两者有什么区别?一个何时会比另一个生效?

答案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应用于登录用户,除非被他们自己的点文件覆盖。

相关内容