Last active
August 14, 2022 17:26
-
-
Save zengxs/a697d786b244d7b857d3d006213306a1 to your computer and use it in GitHub Desktop.
tomcat systemd service script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
Type=forking
-> catalina.sh start
or startup.sh
Type=simple
(default?) -> catalina.sh run
@mr-rycho In the Type=simple model, the process spawned by systemd is the dæmon
catalinE ?! CATALINUS is much better )
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Only way to make tomcat 9.0.14 work with systemd units on Centos 7.6 was with oers example.
Here is what I use (with custom OPTS):