时常需要给服务器打打补丁,执行apt update后执行apt upgrade,但是奇怪的是jenkins升级后就挂了。
没有改什么配置,没有增加什么新的应用。用apt remove jenkins再apt install jenkins也不行。
Setting up jenkins (2.263.1) ...
Job for jenkins.service failed because the control process exited with error code.
See "systemctl status jenkins.service" and "journalctl -xe" for details.
invoke-rc.d: initscript jenkins, action "start" failed.
● jenkins.service - LSB: Start Jenkins at boot time
Loaded: loaded (/etc/init.d/jenkins; generated)
Active: failed (Result: exit-code) since Tue 2021-01-19 10:09:42 CST; 12ms ago
Docs: man:systemd-sysv-generator(8)
Process: 4798 ExecStart=/etc/init.d/jenkins start (code=exited, status=7)
Jan 19 10:09:41 iZ8vbajeqj6nb198cbbtgsZ systemd[1]: Starting LSB: Start Jenkins at boot time...
Jan 19 10:09:41 iZ8vbajeqj6nb198cbbtgsZ jenkins[4798]: Correct java version found
Jan 19 10:09:41 iZ8vbajeqj6nb198cbbtgsZ jenkins[4798]: * Starting Jenkins Automation Server jenkins
Jan 19 10:09:42 iZ8vbajeqj6nb198cbbtgsZ jenkins[4798]: ...fail!
Jan 19 10:09:42 iZ8vbajeqj6nb198cbbtgsZ systemd[1]: jenkins.service: Control process exited, code=exited, status=7/NOTRUNNING
Jan 19 10:09:42 iZ8vbajeqj6nb198cbbtgsZ systemd[1]: jenkins.service: Failed with result 'exit-code'.
Jan 19 10:09:42 iZ8vbajeqj6nb198cbbtgsZ systemd[1]: Failed to start LSB: Start Jenkins at boot time.
dpkg: error processing package jenkins (--configure):
installed jenkins package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
jenkins
E: Sub-process /usr/bin/dpkg returned an error code (1)
试过netstat -apn | grep 8080看端口占用,先是发现过阿里云盾,还以为是中毒了,用top看看cpu占用,不像。
把端口改成8888,也不行。
然后改天,直接执行apt update后执行apt upgrade就好了。原来就是pkg.jenkins.io不能连接造成的。
中间还曾经怀疑过java的问题,网上不少说是java没设置好或者缺少$JAVA_HOME的。并不解决我的问题。
再单独发一下jenkins状态的故障查询。
root@iZ8vbajeqj6nb198cbbtgsZ:~# systemctl status jenkins.service
● jenkins.service - LSB: Start Jenkins at boot time
Loaded: loaded (/etc/init.d/jenkins; generated)
Active: failed (Result: exit-code) since Mon 2021-01-18 17:30:42 CST; 1min 56s ago
Docs: man:systemd-sysv-generator(8)
Process: 1878 ExecStart=/etc/init.d/jenkins start (code=exited, status=7)
Jan 18 17:30:41 iZ8vbajeqj6nb198cbbtgsZ systemd[1]: Starting LSB: Start Jenkins at boot time...
Jan 18 17:30:41 iZ8vbajeqj6nb198cbbtgsZ jenkins[1878]: Correct java version found
Jan 18 17:30:41 iZ8vbajeqj6nb198cbbtgsZ jenkins[1878]: * Starting Jenkins Automation Server jenkins
Jan 18 17:30:42 iZ8vbajeqj6nb198cbbtgsZ jenkins[1878]: ...fail!
Jan 18 17:30:42 iZ8vbajeqj6nb198cbbtgsZ systemd[1]: jenkins.service: Control process exited, code=exited, status=7/NOTRUNNING
Jan 18 17:30:42 iZ8vbajeqj6nb198cbbtgsZ systemd[1]: jenkins.service: Failed with result 'exit-code'.
Jan 18 17:30:42 iZ8vbajeqj6nb198cbbtgsZ systemd[1]: Failed to start LSB: Start Jenkins at boot time.