Systemd

Tomcat 9 needs the WorkingDirectory specified in the Systemd service in order to work. Without it, the service will start but never completely load!

To use, put this is in /etc/systemd/system/tomcat.service and install the service as usual.


[Unit]
Description=Apache Tomcat Web Application Container
After=network.target
After=systemd-user-sessions.service
After=network-online.target

[Service]
User=tomcat
Group=tomcat
Type=forking
WorkingDirectory=/app/XXX/bin
ExecStart=/bin/bash /app/XXX/bin/catalina.sh start
ExecStop=/bin/bash /app/XXX/bin/catalina.sh stop

[Install]
WantedBy=multi-user.target