tomcat7配置systemd服务示例
[Unit]
Description=tomcat7
After=syslog.target network.target remote-fs.target nss-lookup.target
[Service]
Type=forking
Environment='JAVA_HOME=/usr/java/jdk1.8.0_151'
Environment='CATALINA_PID=/var/run/tomcat7.pid'
Environment='CATALINA_HOME=/usr/local/apache-tomcat-7.0.82/'
Environment='CATALINA_BASE=/usr/local/apache-tomcat-7.0.82/'
Environment='CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC'
WorkingDirectory=/usr/local/apache-tomcat-7.0.82/
PIDFile=/var/run/tomcat7.pid
ExecStart=/usr/local/apache-tomcat-7.0.82/bin/startup.sh
ExecReload=/usr/local/apache-tomcat-7.0.82/bin/catalina.sh restart
ExecStop=/usr/local/apache-tomcat-7.0.82/bin/catalina.sh stop
PrivateTmp=true
User=root
Group=root
[Install]
WantedBy=multi-user.target