Tomcat 的 Systemctl 启动脚本
环境
- CentOS 7
编写启动脚本
[root@localhost ~]# vim /usr/lib/systemd/system/tomcat.service [Unit] Discription=tomcat server After=network.target [Service] Environment="JAVA_HOME=/usr/local/java/jdk1.8.0_191" Type=forking ExecStart=/usr/local/apache-tomcat-8.5.35/bin/startup.sh ExecStop=/usr/local/apache-tomcat-8.5.35/bin/shutdown.sh [Install] WantedBy=multi-user.target
授权
[root@localhost ~]# chmod 655 /usr/lib/systemd/system/tomcat.service
重新加载单元
[root@localhost ~]# systemctl daemon-reload
转 : https://www.cnblogs.com/itwangqiang/articles/14473393.html