且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Jenkins无法在Linux中启动

更新时间:2023-01-17 22:20:28

因此,知道这是一个启动前错误,使我可以进行更深入的研究.

So, knowing it was a pre-start error allowed me to investigate more deeply.

进一步的挖掘使我发现/etc/init/jenkins.conf文件中的确切行是指向/usr/share/jenkins/bin/maintain-plugins.sh

Further digging allowed me to figure out that the exact line in the /etc/init/jenkins.conf file was one pointing to the /usr/share/jenkins/bin/maintain-plugins.sh

看着这个位置,我发现它不存在(即没有bin目录).这意味着jenkins-common出于某种原因不再安装...确实确实...进入apt-get并再次安装此组件会导致错误:

Looking at this location, I found it was not present (ie. no bin directory). This means that jenkins-common was no longer installed for some reason...odd indeed...going into apt-get and doing an install of this component again led to the error:

dpkg error processing /var/cache/apt/archives/jenkins-common_1.409.1-0ubuntu4.2_all.deb ...

之前曾见过此错误,并通过google刷新了我的记忆,给出了以下解决方案:

having seen this error before and refreshing my memory via google gave the following solution:

dpkg -i --force-overwrite /var/cache/apt/archives/jenkins-common_1.409.1-0ubuntu4.2_all.deb

这使common的安装可以正常进行.此后,我要做的就是用备份的副本替换/usr/share/jenkins/jenkins.war(因为ubuntu远远落后于最新发行版),并且我能够再次启动服务器.

This allowed the installation of common to proceed as normal. After this, all I had to do was replace the /usr/share/jenkins/jenkins.war with my backed up copy (because ubuntu is far behind the latest release version), and I was able to start the server again.

我不确定是什么原因导致了问题的开始,但是很可能是在apt-get升级/清理过程中……而且由于jenkins与jenkins的冲突很奇怪-常见,因此并没有重新填充/usr/share/jenkins目录正确.

I am not exactly sure what caused the problem to begin with, but it was likely during an apt-get upgrade/clean process...and because of the weirdness with jenkins conflicting with jenkins-common, it did not repopulate the /usr/share/jenkins directory properly.

无论如何,很高兴它又能正常工作. :)

regardless, am glad it is working again. :)