upstart for jenkins-slave does mkdir after it has tried to use it

Bug #961691 reported by Al Stone
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
jenkins (Ubuntu)
Fix Released
Medium
James Page
Precise
Fix Released
Medium
James Page

Bug Description

In /etc/init/jenkins-slave.conf, there are these lines:

pre-start script
    [ -r /etc/default/jenkins-slave ] && . /etc/default/jenkins-slave
    [ -n "$JENKINS_URL" ] || { stop; exit 0; }
    $JENKINS_ROOT/bin/download-slave.sh $JENKINS_URL
    mkdir $JENKINS_RUN > /dev/null 2>&1 || true
    chown -R $JENKINS_USER $JENKINS_RUN || true
end script

The download-slave.sh script tries to create $JENKINS_RUN/slave.jar, but $JENKINS_RUN doesn't exist yet so the slave will not start. If we change the pre-start to:

pre-start script
    [ -r /etc/default/jenkins-slave ] && . /etc/default/jenkins-slave
    [ -n "$JENKINS_URL" ] || { stop; exit 0; }
    mkdir $JENKINS_RUN > /dev/null 2>&1 || true
    chown -R $JENKINS_USER $JENKINS_RUN || true
    $JENKINS_ROOT/bin/download-slave.sh $JENKINS_URL
end script

...then all is well on restart.

Related branches

James Page (james-page)
Changed in jenkins (Ubuntu):
status: New → Confirmed
importance: Undecided → Medium
milestone: none → ubuntu-12.04-beta-2
assignee: nobody → James Page (james-page)
Changed in jenkins (Ubuntu Precise):
status: Confirmed → In Progress
Revision history for this message
James Page (james-page) wrote :

Nice spot Al

I'll upload the fix to precise shortly (I'm going todo a sweepup into Debian as well in the next week or so).

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package jenkins - 1.424.6+dfsg-0ubuntu2

---------------
jenkins (1.424.6+dfsg-0ubuntu2) precise; urgency=low

  * d/jenkins-slave.upstart.in: Ensure /var/run/jenkins exists before
    trying to download the jenkins slave.jar file to it (LP: #961691).
    Thanks to Al Stone for providing this fix.
 -- James Page <email address hidden> Thu, 22 Mar 2012 11:44:47 +0000

Changed in jenkins (Ubuntu Precise):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.