Jenkins加入systemctl管理


  Jenkins安裝目錄為 /usr/local/jenkins-tomcat/

  添加文檔

/usr/lib/systemd/system/jenkins.service

  

[Unit]
Description=jenkins
After=network.target

[Service]
Type=forking
#PIDFile=/usr/local/tomcat/tomcat.pid
ExecStart=/usr/local/jenkins-tomcat/bin/startup.sh
ExecReload=
ExecStop=/usr/local/jenkins-tomcat/bin/shutdown.sh
PrivateTmp=true

[Install]
WantedBy=multi-user.target

  重新導入systemctl

 systemctl daemon-reload

  手動關閉jenkins然后使用systemctl啟動並且添加至自啟動

 /usr/local/jenkins-tomcat/bin/shutdown.sh
systemctl start jenkins
systemctl enable jenkins

  


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM