The Joy of Hex

Drunken Monkey Coding Style with a hint of Carlin humor

Sep 20, 2011 - 1 minute read - Jenkins Linux Ubuntu

Changing the Jenkins home directory on Ubuntu - take 2

A month ago, Robert blogged about changing the Jenkins CI home directory on Ubuntu.

Only thing I did not like was setting the path directly in the DAEMON_ARGS and excluding the $JENKINS_HOME variable.

It may not be a problem, but just in case, wouldn’t it be better if we just defined the $JENKINS_HOME to point to the new home directory? That way, any part of the Jenkins that relies on the $JENKINS_HOME will know where to look.

Instead of editing /etc/init.d/jenkins, and modifying it like Robert suggests to

DAEMON_ARGS="--name=$NAME --inherit --env=JENKINS_HOME=/home/jenkins --output=$JENKINS_LOG --pidfile=$PIDFILE"

I would suggest editing the /etc/default/jenkins

vi /etc/default/jenkins

And changing the $JENKINS_HOME variable (around line 23) to

# jenkins home location

Then restart the Jenkins with usual

/etc/init.d/jenkins start