創(chuàng)建文件
# 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
進(jìn)入目錄
# cd /etc/systemd/system/
設(shè)置開機(jī)啟動(dòng)
# systemctl enable tomcat
查詢當(dāng)前tomcat的狀態(tài):
# systemctl status tomcat
關(guān)閉tomcat:
# systemctl stop tomcat
關(guān)閉開機(jī)自啟:
# systemctl disable tomcat
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。