tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alan Chaney <a...@compulsivecreative.com>
Subject Re: jsvc creates pid file owned by root
Date Sat, 12 Apr 2008 17:20:30 GMT
Hi Chris

Christopher Schultz wrote:
> Are you sure you are changing the umask for the jsvc process? I wonder
> if the umask is being re-set to something else when jsvc elevates itself
> to root. You should ask the commons folks about how to do this with
> jsvc, as this is really off-topic, here (but we'd love to hear the
I posted an answer to this a couple of days ago. I don't think the OP 
quite understands
that 'umask' is a *shell* command. Consequently if you have a shell 
script like 'tomcat' for jsvc or startup.sh
you must set the umask in the shell script because a new shell is 
created each time.

As I posted in my example, I set umask to 027 in my jsvc startup script 
and it works just fine. tomcat starts as root, binds to the ports and 
then switches to the 'tomcat' user. The pid file is owned by root (as it 
should be) and  files created by tomcat are '640' which is what I wanted.

Another point that I think the OP was confused about was that you *must* 
have root permission to bind to system ports in linux - so you must 
either start tomcat as root or with a script invoked by 'sudo'


You can also set umask in /etc/profile which will apply to all users - 
but probably not a good thing to do.

HTH

Alan


> answer for the future).
>
> Good luck,
> - -chris
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
>
> iEYEARECAAYFAkgA6g4ACgkQ9CaO5/Lv0PBGTwCeM+4lBoXTnwzHkeirmROqWfuC
> co8AoJIEHbsD5gzfQxM8XNpwOeqrSdKf
> =euMt
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>
> !DSPAM:4800eac534083966023671!
>


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message