Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Example systemd unit file for tomcat 7.x
# Systemd unit file for tomcat 7.x
[Unit]
Description=Apache Tomcat 7.x Web Application Container
Wants=syslog.target network.target
After=syslog.target network.target
[Service]
Type=forking
Environment=JAVA_HOME=/usr/java/latest
Environment=CATALINA_PID=/run/tomcat.pid
Environment=CATALINA_HOME=/home/tomcat/tomcat
Environment=CATALINA_BASE=/home/tomcat/tomcat
Environment='CATALINA_OPTS=-Xms1G -Xmx1G -Djava.net.preferIPv4Stack=true'
Environment='JAVA_OPTS=-Djava.awt.headless=true'
ExecStart=/home/tomcat/tomcat/bin/startup.sh
ExecStop=/bin/kill -15 $MAINPID
PIDFile=/run/tomcat.pid
SuccessExitStatus=143
User=tomcat
Group=tomcat
UMask=0007
RestartSec=10
Restart=always
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment