systemd tomcat8 服务
2020-11-11 本文已影响0人
答春竹
vim /usr/lib/systemd/system/tomcat8.service
[Unit]
Description=tomcat8
After=syslog.target network.target remote-fs.target nss-lookup.target
[Service]
Type=forking
Environment='JAVA_HOME=/usr/java/jdk1.8.0_261-amd64'
Environment='CATALINA_PID=/usr/local/tomcat8/tomcat8.pid'
Environment='CATALINA_HOME=/usr/local/tomcat8'
Environment='CATALINA_BASE=/usr/local/tomcat8'
Environment='CATALINA_OPTS=-Xms8048m -Xmx8048m -Xss64m -XX:MetaspaceSize=256m -XX:MaxMetaspaceSize=522m -XX:PermSize=256M -XX:MaxPermSize=512M -server -XX:+UseParallelGC'
WorkingDirectory=/usr/local/tomcat8
PIDFile=/usr/local/tomcat8/tomcat8.pid
ExecStart=/usr/local/tomcat8/bin/startup.sh
ExecReload=/usr/local/tomcat8/bin/catalina.sh restart
ExecStop=/usr/local/tomcat8/bin/shutdown.sh
PrivateTmp=true
User=root
Group=root
[Install]
WantedBy=multi-user.target