I used this procedure to install Jenkins:
https://wiki.jenkins-ci.org/display/JENKINS/Installing+Jenkins+on+RedHat+distributions
After it was up and running I discovered the /var/lib/jenkins partition on my server is very small. I want to move it, but I do not want to change the user that it runs under. I am new to Linux and I'm stumped. How do I move it for example to my Home/Public folder? The "Jenkins" user doesn't seem to have a Home folder. Its running as a daemon on startup, so I have no idea where to configure those settings. Can I create a Home folder for the Jenkins user? How?
I read this article:
https://wiki.jenkins-ci.org/display/JENKINS/Administering+Jenkins
but do not understand HOW to "set the new Jenkins home". I have used the export command, and restarted the service, but the old path still shows up in the Manage Jenkins screens.
I've read the 2-3 similar questions on stackoverflow also, but there's always a big missing piece for me. Where to find that file where I change the path permanently?
Change Jenkins Home on Linux Note: The default location for the Jenkins configuration file on Ubuntu and Debian is /etc/default/jenkins. If you are working with RedHat, CentOS, or Fedora, the Jenkins configuration file is located at /etc/sysconfig/jenkins.
Open the file using a text editor such as Notepad or Notepad++. Scroll down until you find the line that contains --httpPort=8080 and change the number to the port you want to set. Note: If you are using HTTPS with Jenkins, use java -jar jenkins. war --httpsPort=[port number] to change the port in the command prompt.
Here's an easy way to solve your problem. First, move the Jenkins directory from /var/lib/jenkins
to /home/jenkins
. Then create a symlink at /var/lib/jenkins
pointing to /home/jenkins
. And of course, stop the Jenkins service before doing that.
sudo service jenkins stop sudo mv /var/lib/jenkins /home sudo ln -s /home/jenkins /var/lib/jenkins sudo service jenkins start
I managed to change the home location for Jenkins by modifying content of /etc/sysconfig/jenkins file as follows:
JENKINS_HOME="/home/jenkins"
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