cat /etc/systemd/system/tomcat.service
-----------------------------------------------------------------
[Unit]
Description="tomcat 8"
After=network.target syslog.target

[Service]
Type=forking
Environment="JAVA_HOME=/usr/java/java-1.8.0"
Environment="JAVA_OPTS=-Xmx800m -Xms800m -Djava.net.preferIPv4Stack=true"
Environment="CATALINA_HOME=/usr/java/tomcat8"
Environment="CATALINA_BASE=/usr/java/tomcat8/server1"
User=root
Group=root
ExecStart=/usr/java/tomcat8/bin/startup.sh
ExecStop=/usr/java/tomcat8/bin/shutdown.sh

[Install]
WantedBy=multi-user.target
---------------------------------------------------------------
systemctl enable tomcat
systemctl start tomcat
systemctl status tomcat
systemctl stop tomcat

Posted by jtfafa
,