# vi /etc/systemd/system/tomcat.service
[Unit]
Description=Tomcat8540
After=syslog.target network.target remote-fs.target nss-lookup.target
[Service]
Type=oneshot
ExecStart=/usr/local/apache-tomcat-8.5.40/bin/startup.sh
ExecStop=/usr/local/apache-tomcat-8.5.40/bin/shutdown.sh
ExecReload=/bin/kill -s HUP $MAINPID
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
# cd /etc/systemd/system/
# systemctl enable tomcat
# systemctl status tomcat
# systemctl stop tomcat
# systemctl disable tomcat