Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The title says it all. I need Tomcat's webdav servlet to create files with rw-rw-r-- rights, but it keeps creating it as rw-r--r--. I tried to set up umask in /etc/profile, but it didn't help (although manualy created new files has desired permission settings). According to /etc/passwd the user that runs Tomcat has /etc/false as shell and has no bashrc in his home directory. The host os is Debian.

share|improve this question
up vote 4 down vote accepted

While this is completely a hack, open up tomcat/bin/ and set 'umask 0002' in it. You could also do this in, you get the idea - you could even find right where java launches in (search for "catalina.out") and put it directly above that logic block to ensure it's effective when java is let loose on your poor CPU.

share|improve this answer
I have found out that the umask is actually set in the init.d script (that's why setting it in /etc/profile didn't help). So I simply changed that line in /etc/init.d/tomcat6 script and it worked. – Jun 30 '10 at 14:44
Yah - the issue is that there's no standard for Tomcat/JBoss SysV startup, everyone rolls their own. Glad you found out for your situation and did the right thing. – troyengel Jul 5 '10 at 7:00

Your Answer


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.