--- bin/tomcat-example.service (nonexistent) +++ bin/tomcat-example.service (working copy) @@ -0,0 +1,25 @@ +[Unit] +Description=Apache Tomcat Web Application Container +After=syslog.target network.target + +[Service] +Type=forking + +Environment=JAVA_HOME=/usr/lib/jvm/java-8-oracle/ +Environment=CATALINA_PID=/opt/apache/apache-tomcat/temp/tomcat.pid +Environment=CATALINA_HOME=/opt/apache/apache-tomcat +Environment=CATALINA_BASE=/opt/apache/apache-tomcat +Environment='CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC' +Environment='JAVA_OPTS=-Djava.awt.headless=true -Djava.security.egd=file:/dev/./urandom' + +ExecStart=/opt/apache/apache-tomcat/bin/startup.sh +ExecStop=/bin/kill -15 $MAINPID + +User=tomcat +Group=tomcat +UMask=0007 +RestartSec=10 +Restart=always + +[Install] +WantedBy=multi-user.target --- webapps/docs/setup.xml (revision 1820411) +++ webapps/docs/setup.xml (working copy) @@ -109,6 +109,18 @@ +
+ +

On systems that use systemd to manage it's daemons you can use that to run tomcat.

+ +

In the copy the file bin/tomcat-example.service to /etc/systemd/system/tomcat.service + and modify the paths in it to reflect your java and tomcat installation paths.

+ +

Then do systemctl daemon-reload to load the config file and then you can start + tomcat with systemctl start tomcat.service and stop it with systemctl stop tomcat.service

+ +
+

Tomcat can be run as a daemon using the jsvc tool from the