What is the difference between the
umask setting that can be found in
/etc/profile and the
cmask setting that can be found in
What is the difference between the two? When will one take effect over the other?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
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 setting in
/etc/profile will apply to logged-in users, unless overridden by their own dot-files.