You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Thomas Hoffmann (Speed4Trade GmbH)" <Th...@speed4trade.com.INVALID> on 2023/03/17 15:00:06 UTC

Systemd file and umask for tomcat

Hello,
today I was struggling with the umask on ubuntu and tomcat.

The normal way to do it in systemd is:

[Service]
UMask=0022

Unfortunately, this didn’t work and it took me a while to figure out, that Catalina.sh
is overwriting the umask with 0027 if no env-variable was set.
So for tomcat, I needed to set:
Environment='UMASK=0022'

Is there any reason, why tomcat has some unexpected logic which overrides the systemd settings?

Thanks! Thomas

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


Re: Systemd file and umask for tomcat

Posted by Simon Matter <si...@invoca.ch>.
> Hello,
> today I was struggling with the umask on ubuntu and tomcat.
>
> The normal way to do it in systemd is:
>
> [Service]
> UMask=0022
>
> Unfortunately, this didn’t work and it took me a while to figure out, that
> Catalina.sh
> is overwriting the umask with 0027 if no env-variable was set.
> So for tomcat, I needed to set:
> Environment='UMASK=0022'
>
> Is there any reason, why tomcat has some unexpected logic which overrides
> the systemd settings?

I think Tomcat uses its own way to do things so that it can do it in all
platforms in the same way. Outside of Linux, nobody is using systemd
anyway :)

Therefore I have this in setenv.sh

# Umask for system reserved uid/gid
if [ -z "$UMASK" ]; then
  UMASK="0022"
fi

Regards,
Simon



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