Fix for ‘jenkins dead but pid file exists’ error

Read Time: 1 min

 



Here is the Fix for error jenkins dead but pid file exists. You see this error when you check Jenkins service status. One important thing to note that you won’t find this error while starting the Jenkins service.

[[email protected] vagrant]# /etc/init.d/jenkins start
Starting Jenkins                                           [  OK  ]
[[email protected] vagrant]# /etc/init.d/jenkins status
jenkins dead but pid file exists

#Fix1:

This issue can happen if Jenkins’s user does not have enough permission on /var/log/jenkins and /var/cache/jenkins . Permission issue usually happens when you change Jenkins user from default.

First find your Jenkins user:

CentOS/RedHat:

[[email protected] vagrant]# cat /etc/sysconfig/jenkins | grep JENKINS_USER
JENKINS_USER="jarvis"

Debian/Ubuntu:

[[email protected] vagrant]# cat /etc/default/jenkins | grep JENKINS_USER
JENKINS_USER="jarvis"

Now make all files and directories under /var/log/jenkins and /var/cache/jenkins owned by the Jenkins user.

chown -R jarvis. {/var/log/jenkins/,/var/cache/jenkins/}

Then give proper permission for all files and directories.

find {/var/cache/jenkins,/var/log/jenkins} -type f -exec chmod 644 {} \;
find {/var/cache/jenkins,/var/log/jenkins} -type d -exec chmod 755 {} \;

Jenkins should be fine now.

[[email protected] vagrant]# /etc/init.d/jenkins start
Starting Jenkins                                           [  OK  ]
[[email protected] vagrant]# /etc/init.d/jenkins status
jenkins (pid  9049) is running...

 

A Site Reliability Engineer and an automation enthusiast.
Posts created 37

Begin typing your search term above and press enter to search. Press ESC to cancel.

Back To Top
x