Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
tomcat systemd service
[root@irida ~]# cat /usr/lib/systemd/system/tomcat-10.0.14.service
Description=Apache Tomcat Server 10.0.14
After=syslog.target network.target
[Service]
Type=forking
User=tomcat
Group=tomcat
PIDFile=/opt/tomcat/10.0.14/run/tomcat.pid
Environment=JAVA_OPTS="-Dspring.profiles.active=prod -Dirida.db.profile=prod"
Environment=CATALINA_PID=/opt/tomcat/10.0.14/run/tomcat.pid
Environment=CATALINA_HOME=/opt/tomcat/10.0.14
Environment=CATALINA_BASE=/opt/tomcat/10.0.14
Environment=CATALINA_TMPDIR=/opt/tomcat/10.0.14
#Environment=JRE_HOME=/usr/lib/jvm/java-11-openjdk-11.0.9.11-3.el8_3.x86_64
#Environment=JRE_HOME=/usr/lib/jvm/java-11-openjdk-11.0.11.0.9-0.el8_3.x86_64
#Environment=JRE_HOME=/usr/lib/jvm/java-11-openjdk-11.0.11.0.9-2.el8_4.x86_64
#Environment=JRE_HOME=/usr/lib/jvm/java-11-openjdk-11.0.12.0.7-0.el8_4.x86_64
Environment=JRE_HOME=/usr/lib/jvm/java-17
Environment=LD_LIBRARY_PATH=/opt/tomcat/10.0.14/lib
ExecStart=/opt/tomcat/10.0.14/bin/catalina.sh start
ExecStop=/opt/tomcat/10.0.14/bin/catalina.sh stop
#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