Databases
cancel
Showing results for 
Search instead for 
Did you mean: 

umask for daemons at boot time

james mcintyre_1
Occasional Advisor

umask for daemons at boot time

does anyone know what determines the umask for the daeamons at boot time ?

this questions is for both 10.x and 11.x

thanks.....
7 REPLIES
Jim Turner
HPE Blogger

Re: umask for daemons at boot time

James,

If the daemons you speek of are the ones that inetd start as a result of network connections (like telnetd and ftpd), you can edit /etc/inetd.conf and set your umask for the daemons there.

For example, change
ftp stream tcp nowait root /usr/lbin/ftpd ftpd -l
to
ftp stream tcp nowait root /usr/lbin/ftpd ftpd -l -u 077
to switch from the default 027 to 077.

You can also place a "global" umask in /etc/profile like "umask 077". This will affect all users.

Cheers,
Jim

-----
Was this information helpful? If so, please like and give kudos. Thanks!
Jim Turner
HPE Blogger

Re: umask for daemons at boot time

And of course if you *do* edit your /etc/inetd.conf file, always remember to "inetd -c" afterwards to make the new config effective.

-----
Was this information helpful? If so, please like and give kudos. Thanks!
A. Clay Stephenson
Acclaimed Contributor

Re: umask for daemons at boot time

The bad news is that some daemons set umask themselves so that nothing you do will have any effect.
If it ain't broke, I can fix that.
james mcintyre_1
Occasional Advisor

Re: umask for daemons at boot time

the daemons/processes that are started at boot time via /sbin/init.d.

thanks....jim mc....
Chris Calabrese
Valued Contributor

Re: umask for daemons at boot time

Assuming the deamon or its startup file don't set their own umask, they inherit the
umask 022
directive in /sbin/rc.
Brainbench MVP for Unix Administration and Internet Security, SANS Review Editor, and Center for Internet Security HP-UX Benchmark project leader
Magdi KAMAL
Respected Contributor

Re: umask for daemons at boot time

Hi James,

In the step by step daemon creation is the setting of the file mode creation mask (umask) to ZERO. It has to be set to ZERO and then to the specified value required by the daemon process.

If the daemon process is going to create files, it may want to set specific permissions.
Chris Calabrese
Valued Contributor

Re: umask for daemons at boot time

That is simply not true. As I stated above, the umask is set to 022 in /sbin/rc. Some startup scripts explicitly reset this, but 022 is the default. Note that one of the startup scripts that resets this is the one for inetd, so any processes started by inetd will have umask 0.
Brainbench MVP for Unix Administration and Internet Security, SANS Review Editor, and Center for Internet Security HP-UX Benchmark project leader