[CentOS] running tomcat as non-root user.. (/var/run pidfile issue)

Jason Welsh

jason.welsh at mercurygate.com
Thu May 4 15:06:34 UTC 2017


hey folks, we are migrating our tomcat setup over to centos 7. Im 
converting init-scripts over to systemd services and whatnot.. One thing 
that Ive noticed is that my systemd startup script cant seem to write to 
/var/run as a non-root user to drop a pidfile.. If I create a directory 
in /var/run owned by my user, it gets wiped out on reboot.

Ive searched and found this

https://blog.hqcodeshop.fi/archives/93-Handling-varrun-with-systemd.html

which says to use ExecStartPre to fudge creating directories in /var/run 
so what non-root users can write there..

Is that the suggested way to do this? It seems awful kludgey.


Jason






More information about the CentOS mailing list