What is the difference between the umask setting that can be found in /etc/profile and the cmask setting that can be found in /etc/default/init?

What is the difference between the two? When will one take effect over the other?


The manpage for init describes the contents of /etc/default/init, and says:

 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 starts or restarts core service components and processes, so the CMASK affects the permissions of these and any daemons spawned by init. In particular, daemons creating new directories would use this CMASK value as their umask.

The umask setting in /etc/profile will apply to logged-in users, unless overridden by their own dot-files.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.