Skip to content

Commit

Permalink
[FIXED JENKINS-20407] /var/run/jenkins may not exist
Browse files Browse the repository at this point in the history
Test for the existence of /var/run/jenkins before trying to chown it in
the Debian post-install script.

Originally-From: jenkins-ci.org/commit/core/cab3d5daa7d8486ec6da3eed2be8424f12bfb046
  • Loading branch information
mblair authored and vjuranek committed Nov 9, 2013
1 parent 71118ff commit ab3fd69
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions debian/jenkins.postinst
Expand Up @@ -52,11 +52,16 @@ case "$1" in
chmod u+rwx /var/lib/jenkins /var/log/jenkins

# make sure jenkins can delete everything in /var/cache/jenkins to
# re-explode war. older installations may use /var/run/jenkins
# re-explode war.
chown -R $JENKINS_USER:adm /var/cache/jenkins
chmod -R 750 /var/cache/jenkins

# older installations may use /var/run/jenkins
# so make sure that they can delete too.
mkdir -p /var/run/jenkins
chown -R $JENKINS_USER:adm /var/cache/jenkins /var/run/jenkins
chmod -R 750 /var/cache/jenkins /var/run/jenkins
if test -d /var/run/jenkins ; then
chown -R $JENKINS_USER:adm /var/run/jenkins
chmod -R 750 /var/run/jenkins
fi
;;

abort-upgrade|abort-remove|abort-deconfigure)
Expand Down

0 comments on commit ab3fd69

Please sign in to comment.