[root@node2system]#catlibsystemdsystemtomcat.service[Unit]DescriptionTomcatAftersyslog.tar [root@node2 system]# cat /lib/systemd/system/tomcat.service [Unit]Description=TomcatAfter=syslog.target network.target remote-fs.target nss-lookup.tar
[root@node2 system]# cat /lib/systemd/system/tomcat.service [Unit]Description=TomcatAfter=syslog.target network.target remote-fs.target nss-lookup.target
[Service]Type=forking EnvirOnment="JAVA_HOME=/usr/local/jdk" PIDFile=/data/tomcat/tomcat.pidExecStart=/data/tomcat/bin/startup.shExecReload=/bin/kill -s HUP $MAINPIDExecStop=/bin/kill -s QUIT $MAINPIDPrivateTmp=true
[Install]WantedBy=multi-user.target
systemctl daemon-reloadsystemctl stop/start/restart/status tomcat.service
如果不能直接启动
tomcat配置pid
vim ../tomcat/bin/catalina.sh
此位置添加 CATALINA_PID="$CATALINA_BASE/tomcat.pid"
重新执行以上命令
【感谢龙石数据为本站数据中台建设方案 http://www.longshidata.com/pages/government.html,感恩 】