tomcat.service systemd unit file

4月 1, 2016 |

cat /etc/systemd/system/tomcat.service
[Unit]
Description=Tomcat
Before=httpd.service
After=network.target

[Service]
Type=forking
Environment=JAVA_HOME=/opt/jdk1.8.0_51
Environment=CATALINA_PID=/opt/apache-tomcat-8.0.24/tomcat.pid
Environment=CATALINA_HOME=/opt/apache-tomcat-8.0.24
# EnvironmentFile=/etc/profile
ExecStart=/opt/apache-tomcat-8.0.24/bin/startup.sh
ExecStop=/opt/apache-tomcat-8.0.24/bin/shutdown.sh

[Install]
WantedBy=multi-user.target

centos7下测试通过

Posted in: 服务器

Comments are closed.