[Unit]
Description=Apache Tomcat Web Application Container
After=network.target remote-fs.target nss-lookup.target
[Service]
Type=forking
Environment=JAVA_HOME=/opt/jdk
Environment=CATALINA_HOME=/opt/tomcat8
Environment=CATALINA_BASE=/opt/tomcat8
ExecStart=/bin/bash /opt/tomcat8/bin/startup.sh
ExecStop=/opt/tomcat8/bin/shutdown.sh
[Install]
WantedBy=multi-user.target
在/etc/systemd/system/目录下编辑tomcat.service文件
执行systemctl start tomcat.service的时候就会出错
在ExecStart没有加/bin/bash的时候就会报错 The process' exit code is 'exited' and its exit status is 203.