I run Tomcat 7 in my Centos 7 machine, with systemd, under a user webapp different from the default tomcat. I guess it should be easy to accomplish this but I'm having problems.
From what I see there are three places where the user and group can be specified:
/etc/tomcat/tomcat.conf/etc/sysconfig/tomcat/lib/systemd/system/tomcat.service
The latest one, tomcat.service, has indeed the default settings
User=tomcat
Group=tomcat
which I can change. The problem is that the tomcat.service file is overwritten in each update. This doesn't happen with tomcat.conf (here a tomcat.conf.rpmnew is created instead). However, I don't see how I can override the user there.
This behaviour seems strange to me. Does this imply that I'm not supposed to edit tomcat.service? Which is the recommended way to customize tomcat.service?