LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (https://www.linuxquestions.org/questions/fedora-35/)
-   -   How to set umask for nologin account ? (https://www.linuxquestions.org/questions/fedora-35/how-to-set-umask-for-nologin-account-652569/)

nikaudio 06-30-2008 08:51 AM

How to set umask for nologin account ?
 
Hello,

I have FC5 and I'm glassfish Java EE Server as user glassd. This user have set up shell to /sbin/nologin. Default umask is 0022, I need this account to have umask 0002.
Unfortunately nologin account do not read /etc/profile where I have added in vain:

if [ $UID -eq 502 ]; then
umask 002
fi

# id glassd
uid=502(glassd) gid=502(glassd)

Is there a way to set up umask to 0002 for nologin account ?

Regards to you all
Slawomir

Mr. C. 07-01-2008 03:50 AM

I don't know, but there is most likely a script that is called to startup glassfish. You could add your umask call there. Otherwise, if it is a binary, and there is option to set umask, create a wrapper script which sets umask, and then calls glassfish.

Alternatively, you can use pam to do it:

http://www.kernel.org/pub/linux/libs...pam_umask.html

nikaudio 07-01-2008 06:53 AM

Yes, there is asadmin script to start glassfish, I have added umask 0002 line there and it worked like a charm, thank you.
Regards
Slawomir


All times are GMT -5. The time now is 08:09 PM.