How to set tomcat 7 environment variable for UMASK?

元气小坏坏 提交于 2021-02-17 04:43:22

问题


I want to change the default permissions for the logs created by tomcat from 640 to 644 and that would require to change the umask for tomcat.

The default umask for tomcat user is 027 and I would like to set it to 022.

Can I set a environment variable for tomcat7 in bin/setenv.sh for umask property ? I heard that tomcat8 has a property UMASK, but does version 7 supports this ?


回答1:


Tomcat 8 added:

if [ -z "$UMASK" ]; then
  UMASK="0027"
fi
umask $UMASK

to catalina.sh. This gives you the ability to change it by setting the UMASK environment variable.

Tomcat 7 does not call umask in catalina.sh so setting UMASK is not going to help you. What you can do however is add umask 0022 to setenv.sh and do yourself the same thing tomcat 8 does.



来源:https://stackoverflow.com/questions/45485111/how-to-set-tomcat-7-environment-variable-for-umask

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!