Skip to content

Instantly share code, notes, and snippets.

@iahmad-khan
Forked from zengxs/tomcat.service
Created October 3, 2017 13:52
Show Gist options
  • Save iahmad-khan/cefb4b42bb803a0ccead03ed6cbb74d1 to your computer and use it in GitHub Desktop.
Save iahmad-khan/cefb4b42bb803a0ccead03ed6cbb74d1 to your computer and use it in GitHub Desktop.
tomcat systemd service script
# Systemd unit file for tomcat
[Unit]
Description=Apache Tomcat Web Application Container
After=syslog.target network.target
[Service]
Type=forking
Environment=JAVA_HOME=/usr/lib/jvm/jre
Environment=CATALINA_PID=/opt/tomcat/temp/tomcat.pid
Environment=CATALINA_HOME=/opt/tomcat
Environment=CATALINE_BASE=/opt/tomcat
Environment='CATALINE_OPTS=-Xms128M -Xmx765M -server -XX:+UseParallelGC'
Environment='JAVA_OPTS=-Djava.awt.haedless=true -Djava.security.egd=file:/dev/./urandom'
ExecStart=/opt/tomcat/bin/startup.sh
ExecStop=/bin/kill -15 $MAINPID
User=tomcat
Group=tomcat
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment