How can I change the location where jenkins store temp data in its slaves. Currently, it shuts down the connection to my slaves because it complains about the following
Disk space is too low. Only 0.119GB left on /tmp.
I want to move the tmpdir location to something like /var/tmp/
instead of /tmp
. How can I do that?
To change the temporary directory that Jenkins uses, you need to: append -Djava. io. tmpdir=$JENKINS_HOME/tmp into JENKINS_JAVA_OPTIONS variable in either /etc/sysconfig/jenkins or /etc/default/jenkins file depending on your OS.
It [@tmp folder] contains the content of any library that was loaded at run time.
Just add "-Djava.io.tmpdir=/path/to/tmp" to the java command line options (you don't need any extra service wrapper).
Depending on your installation there might be an existing startup script and/or config file this can go into. On my fedora system, I can add the option to the /etc/sysconfig/jenkins file:
## Type: string ## Default: "-Djava.awt.headless=true" ## ServiceRestart: jenkins # # Options to pass to java when running Jenkins. # JENKINS_JAVA_OPTIONS="-Djava.awt.headless=true -Djava.io.tmpdir=/var/tmp"
On a debian/ubuntu machine, add the following to the file /etc/default/jenkins
:
# use a different tmpdir for jenkins JAVA_ARGS="$JAVA_ARGS -Djava.io.tmpdir=/var/tmp/"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With