Linux 詹金斯死了但pid文件存在

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18476588/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-07 00:41:28  来源:igfitidea点击:

Jenkins dead but pid file exists

linuxjenkins

提问by 3ck

I am running into an issue where a fresh install of Jenkins is not accessible. This is the error and OS details: Upon starting jenkins results in "OK" status message however if I run status-all | grep jenkins it results in:

我遇到了无法访问全新安装的 Jenkins 的问题。这是错误和操作系统详细信息:启动 jenkins 时会导致“OK”状态消息,但是如果我运行 status-all | grep jenkins 结果:

jenkins dead but pid file exists

Running on Red Hat Enterprise Linux Server release 6.2 (Santiago) with Yum as package manager.

在 Red Hat Enterprise Linux Server 6.2 版(圣地亚哥)上运行,使用 Yum 作为包管理器。

rpm -qa | grep java

java-1.7.0-openjdk-1.7.0.19-2.3.9.1.el6_4.x86_64
java-1.6.0-openjdk-1.6.0.0-1.61.1.11.11.el6_4.x86_64
tzdata-java-2011l-4.el6.noarch
libvirt-java-0.4.7-1.el6.noarch
libvirt-java-devel-0.4.7-1.el6.noarch
java-1.6.0-openjdk-devel-1.6.0.0-1.61.1.11.11.el6_4.x86_64

Permissions are:

权限是:

ls -la /var/lib/jenkins/
total 8
drwxr-xr-x   2 jenkins jenkins 4096 Aug 27 00:21 .
drwxr-xr-x. 29 root    root    4096 Aug 27 14:47 ..

Has anyone resolved this before?

有没有人解决过这个问题?

采纳答案by lokesh1607

Change JENKINS_AJP_PORT="8009"(OR whatever value) to JENKINS_AJP_PORT="-1"

JENKINS_AJP_PORT="8009"(或任何值)更改为JENKINS_AJP_PORT="-1"

It will work for sure.

它肯定会起作用。

回答by Brad Peabody

Just a hunch - RHEL/CentOS have file execution disabled on the /tmp directory by default.

只是预感 - 默认情况下,RHEL/CentOS 在 /tmp 目录上禁用文件执行。

Try:

尝试:

mount -o remount,exec /tmp

And then (re)start Jenkins.

然后(重新)启动詹金斯。

That enables binaries to be executed (also .so files to be loaded) from the /tmp/ directory, which it looks like this particular packaging of Jenkins requires in order to load some kind of JNI code. When I tried installing and running on CentOS 6.4 this was the only issue I had.

这使得可以从 /tmp/ 目录执行二进制文件(也可以加载 .so 文件),看起来这个特定的 Jenkins 打包需要加载某种 JNI 代码。当我尝试在 CentOS 6.4 上安装和运行时,这是我遇到的唯一问题。

If that works, then you can either set it so this happens by default at startup using the settings in /etc/fstab (workable but lowers security on your system), or try to hack the startup process of the install you've got (not recommended), or install it using Tomcat or other packaging that doesn't require file execution on the /tmp directory (recommended but more work).

如果可行,那么您可以设置它,以便在启动时使用 /etc/fstab 中的设置(可行但会降低系统的安全性)默认情况下发生这种情况,或者尝试破解您已经安装的启动过程(不推荐),或者使用 Tomcat 或其他不需要在 /tmp 目录上执行文件的包来安装它(推荐但更多工作)。

回答by Miguel Reyes

I was getting the same error, I could not restart the instance in any way.

我遇到了同样的错误,我无法以任何方式重新启动实例。

I did a "yum update" in the server and that fixed the problem.

我在服务器中进行了“yum update”并解决了问题。

  • java version "1.7.0_55"
  • Jenkins ver. 1.571
  • java版本“1.7.0_55”
  • 詹金斯版。1.571

回答by Mohsin - Angular Developer

Please do changes in following steps(Assuming - you want to set port 8888 as jenkins port )

请按照以下步骤进行更改(假设 - 您要将端口 8888 设置为 jenkins 端口)

1. You have to edit /etc/init.d/jenkins.

1. 你必须编辑 /etc/init.d/jenkins。

Add the following two lines at the top of the file after DAEMON_ARGS:

在文件顶部的 DAEMON_ARGS 之后添加以下两行:

HTTP_PORT=8888 JENKINS_ARGS="--httpPort=$HTTP_PORT"

HTTP_PORT=8888 JENKINS_ARGS="--httpPort=$HTTP_PORT"

2.Edit the /etc/sysconfig/jenkins

2.编辑/etc/sysconfig/jenkins

and change

和改变

JENKINS_PORT="8888"

JENKINS_PORT="8888"

Start Jenkins service with the following command from terminal

从终端使用以下命令启动 Jenkins 服务

service jenkins start

Check Jenkins' status

检查詹金斯的状态

service jenkins status

回答by IanWatson

From the logs my issue was java.io.FileNotFoundException: /var/cache/jenkins/war/META-INF/MANIFEST.MF (Permission denied)

从日志我的问题是 java.io.FileNotFoundException: /var/cache/jenkins/war/META-INF/MANIFEST.MF (Permission denied)

Which swithced ownership from my user Jenkins runs as to "jenkins", chown'ing fixed the problem

我的用户詹金斯从我的用户那里获得了所有权,就像“詹金斯”一样,chown'ing 解决了这个问题

回答by Brian Lenoski

Just experienced this problem with RHEL install. The fix for me was to explicitly set the JENKINS_JAVA_CMD configuration parameter.

刚刚在安装 RHEL 时遇到了这个问题。我的解决方法是显式设置 JENKINS_JAVA_CMD 配置参数。

E.g.

例如

sudo vim /etc/sysconfig/jenkins
update:
    JENKINS_JAVA_CMD=""
to:
    JENKINS_JAVA_CMD="/usr/java/default/bin/java"

回答by ItayB

The following helped me:

以下帮助了我:

some time there will be stale some jenkins processes, so ps -ef | grep jenkins kill all of them and restart as above it will be clean.

有一段时间会有一些 jenkins 进程过时,所以 ps -ef | grep jenkins 杀死所有这些并重新启动如上它会是干净的。

ps -ef | grep jenkins
sudo kill -kill <pid>

Taken from here(thanks to @sharp)

取自这里(感谢@sharp)

回答by Isaace Eliussi

Usually the tomcat service is taking over the 8080 port. Try to stop the tomcat service and rerun the jenkins service.

通常tomcat服务在接管8080端口。尝试停止tomcat服务并重新运行jenkins服务。

service tomcat stop;

服务tomcat停止;

service jenkins start

服务詹金斯开始

Worked for me.

为我工作。

回答by Manjunatha.N

cd /etc/sysconfig/jenkins

Change JENKINS_AJP_PORT

更改 JENKINS_AJP_PORT

Change it from

改变它从

JENKINS_AJP_PORT="8009"

to

JENKINS_AJP_PORT="-1"

回答by Vignesh

for the above error i managed to go to /var/run/jenkins.pid and removed an already existing processing ID.

对于上述错误,我设法转到 /var/run/jenkins.pid 并删除了一个已经存在的处理 ID。

Then jenkins process was started and its running successfully now.

然后 jenkins 进程启动并成功运行。