Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins dead but pid file exists

Tags:

linux

jenkins

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 dead but pid file exists

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

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?

like image 251
3ck Avatar asked Aug 27 '13 22:08

3ck


5 Answers

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

It will work for sure.

like image 177
lokesh1607 Avatar answered Nov 17 '22 04:11

lokesh1607


While following AWS tutorial on Set up a build pipeline with Jenkins and Amazon ECS I encountered the exact same error.

Changing ports did not solve the problem.

I figured out that the error was coming from the version of Java installed along Jenkins.

Updated java-1.7.0-openjdk to java-1.8.0-openjdk did the trick

EDIT: From Anatoly comment, to update java:

sudo yum install java-1.8.0-openjdk

and then remove old version:

sudo yum remove java-1.7.0-openjdk.x86_64

Finally, restart jenkins service

sudo service jenkins restart
like image 10
CloC Avatar answered Nov 17 '22 02:11

CloC


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

service tomcat stop;

service jenkins start

Worked for me.

like image 2
Isaace Eliussi Avatar answered Nov 17 '22 02:11

Isaace Eliussi


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.

  • java version "1.7.0_55"
  • Jenkins ver. 1.571
like image 1
Miguel Reyes Avatar answered Nov 17 '22 04:11

Miguel Reyes


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

E.g.

sudo vim /etc/sysconfig/jenkins
update:
    JENKINS_JAVA_CMD=""
to:
    JENKINS_JAVA_CMD="/usr/java/default/bin/java"
like image 1
Brian Lenoski Avatar answered Nov 17 '22 03:11

Brian Lenoski