Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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