一、jenkins进程
[[email protected] jenkins]$ ps -aux|grep jenkins
pilotprd 8228 1.6 2.6 8019372 876820 ? Sl Apr12 2784:25 ./jenkins -Xmx2g -jar latest/jenkins.war
[[email protected] jenkins]$
二、部署目录结构
[[email protected] jenkins]$ tree -L 2
.
|-- 1.617
| `-- jenkins.war
|-- jenkins -> /pilot/java/latest/bin/java
|-- latest -> 1.617
|-- logs
| |-- jenkins.log
| `-- jenkins.pid
|-- start.sh
|-- stop.sh
`-- work
`-- jenkins
5 directories, 6 files
[[email protected] jenkins]$
三、生命周期管理脚本
==============start.sh==============================
export JENKINS_HOME=/pilot/jenkins/work/jenkins
export LOGFILE=logs/jenkins.log
export PIDFILE=logs/jenkins.pid
./jenkins -Xmx2g -jar latest/jenkins.war > $LOGFILE 2>&1 &
echo $! > $PIDFILE
=========stop.sh====================================
mv logs/jenkins.log logs/jenkins.log_old
cat logs/jenkins.pid | xargs kill -9
rm -f logs/jenkins.pid
原文地址:https://www.cnblogs.com/jasmine270885/p/9457863.html