We are trying to start an spring boot app ( default runtime - tomcat ) using a service account with has a umask value of '0002'.

But when spring boot app starts, we see the umask value as '0022'. We verified this by navigating to /proc/status.

We tried to set Environment='UMASK=0002', in the systemd service file, hoping catalina.sh would pick this up. But it is still not picking the right umask. If tomcat is not picking '0002' , how come its starting with umask '0022' ? should not it be '0027' by default.

Comment From: wilkinsona

If you are using catalina.sh then how the process is started and the umask that it will use is out of Spring Boot's control. I can see that Tomcat's default umask is 0027 and that the UMASK environment variable should allow you to override that default. Why that's apparently not working is a question for the Tomcat community. One place where they can be found is the Tomcat users mailing list.