I have an application hosted by jsvc on Centos 6. There are a number of logs created along with it. My problem is that jsvc is creating those logs with 077 permissions which are not accessible by anybody but root. The logs should be readable by anybody.
jsvc.exec -server -Xms1024M -Xmx2048M -cp myapp.jar -errfile /var/log/myapp/error.log -wait 60 com.myawesomecompany.mysuite.myapp
-rw------- 1 root root 370 Feb 26 16:03 error.log
How can I override the default permissions so that any new logs that are generated will have 022 permissions?
jsvc has a
-umaskoption since version 1.0.8 (see this JIRA issue).Please note the
-umaskoption takes a decimal and complemented value, for instance if you want644, you have to complement it (777 - 644 = 133), and then convert the octal value to a decimal one (133->91)...