I want run tomcat9 with a user different from the default, and searching the web, I found out that I can configure this in the file /etc/default/tomcat
. In this file, I change the lines with TOMCAT9-USER
and TOMCAT9_GROUP
and change to the desired user and group I wish tomcat9 was running under. After that, I stop tomcat, and start again (I've trie restart too), but when I run ps -ef
, tomcat still is displayed running under user tomcat. What I am doing wrong here? Is there any other file I need modify?
Ubuntu nowadays mostly "works" with systemd.
Have a look at /lib/systemd/system/tomcat9.service and modify
to your liking.
Thanks for pointing me in this direction, I finally found out why tomcat9 would not expand the .war files (on ubuntu server 2022) in spite of the webapps_ directories having the right user/group permissions. OMG it's setting the directory permissions inside of this file as well, whose crazy idea was that? Like this we have a double administration and it took me 8 hours to get to the only right solution, which is to remove the ProtectSystem setting from this file and allow access via the normal directory attributes as has been done for ages. Come on, stop this kind of nonsense, Ubuntu.