Jenkins dead but pid file exists

I ran into a problem when a new Jenkins installation is not available. This is information about the error and OS: when starting, jenkins leads to a status message "OK", however, if I ran status-all | grep jenkins this results in:

jenkins dead but pid file exists 

Running Red Hat Enterprise Linux Server Version 6.2 (Santiago) with Yum as a 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:

 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?

+6
source share
15 answers

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

This will work for sure.

+10
source

Following the AWS Guide to Customize the Assembly Pipeline Using Jenkins and Amazon ECS I encountered the same error.

Changing the ports did not solve the problem.

I realized that the error came from a version of Java installed on Jenkins.

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

EDIT: From Anatoly's comment to update java:

 sudo yum install java-1.8.0-openjdk 

and then uninstall the old version:

 sudo yum remove java-1.7.0-openjdk.x86_64 

Finally restart the jenkins service

 sudo service jenkins restart 
+5
source

Usually the tomcat service takes port 8080. Try to stop the tomcat service and try the jenkins service again.

stop tomcat service

jenkins start service

Worked for me.

+2
source

I was getting the same error, I just couldn't restart the instance.

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

  • java version "1.7.0_55"
  • Jenkins ver 1,571
+1
source

There was simply a problem installing RHEL. The fix for me was to explicitly set the JENKINS_JAVA_CMD configuration parameter.

eg.

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

Just a hunch - RHEL / CentOS is disabled by default in the / tmp directory.

Try:

 mount -o remount,exec /tmp 

And then (re) run Jenkins.

This allows executables (also .so files to be downloaded) to be executed from the / tmp / directory, which looks like it requires a specific Jenkins package to load some kind of JNI code. When I tried to install and run on CentOS 6.4, this was the only problem I had.

If this works, you can either set it so that it happens by default at startup, using the settings in / etc / fstab (functional, but lowering the security on your system) or trying to crack the installation startup process (not recommended) or install it using Tomcat or other packaging that does not require a file to be executed in the / tmp directory (recommended, but more work).

0
source

Please make changes to the following steps (Assuming you want to set port 8888 as jenkins port)

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

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

http_port = 8888 JENKINS_ARGS = "- HTTPPORT = $ http_port"

2. Modify / etc / sysconfig / jenkins

and change

JENKINS_PORT = "8888"

Start the Jenkins service with the following command from the terminal

 service jenkins start 

Check Jenkins Status

 service jenkins status 

Hope it solves your problem. Please be marked as an answer if you find that the problem is resolved.

0
source

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

What profession from my user Jenkins works for "jenkins", chown'ing fixed the problem

0
source

The following helped me:

some jenkins processes will be idle for some time, so ps -ef | grep jenkins kill everyone and restart as above, they will be clean.

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

Taken from here (thanks @sharp)

0
source
 cd /etc/sysconfig/jenkins 

Edit JENKINS_AJP_PORT

Change it

 JENKINS_AJP_PORT="8009" 

to

 JENKINS_AJP_PORT="-1" 
0
source

for the above error, I managed to go to /var/run/jenkins.pid and delete the existing processing identifier.

Then the jenkins process was started and now it works successfully.

0
source

Verify that the owner of the jenkins.log file is a user of jenkins

 chown jenkins:jenkins jenkins.log 

Without proper ownership, Jenkins will work as soon as you start the service

0
source

Try changing the user from jenkins to root in / etc / sysconfig / jenkins

 JENKINS_USER="root" 

OR

check ownership of /var/lib/jenkins /var/cache/jenkins

Change the ownership of jenkins and change the user in / etc / sysconfig / jenkins to "jenkins", it will work. Also change ownership to /var/logs/jenkins

0
source

The error I had was related to the fact that /var/run/jenkins belonged to the root user and not to the jenkins user. The following is fixed for me:

 sudo chown -R jenkins:jenkins /var/run/jenkins 
0
source
 sudo vim /etc/sysconfig/jenkins update: JENKINS_USER="jenkins" to: JENKINS_USER="root" 

work for me

-1
source

Source: https://habr.com/ru/post/952624/


All Articles