amphibient
amphibient

Reputation: 31212

How to change Jenkins config directory?

I deployed my Jenkins to Tomcat 7. At that time, my tomcat was running under user root (on CentOS 7). The Jenkins config was placed in /root/.jenkins.

Now I want to run my Tomcat as a different user. The startup resulted in errors obviously because it couldn't access root's home directory.

How can I switch the Jenkins config from root to somewhere accessible by the new user under which Jenkins runs?

Upvotes: 0

Views: 332

Answers (1)

shizhz
shizhz

Reputation: 12491

As its official documents says, you have the following three options to change jenkins home directory:

  • Set "JENKINS_HOME" environment variable to the new home directory before launching the servlet container.
  • Set "JENKINS_HOME" system property to the servlet container.
  • Set JNDI environment entry "JENKINS_HOME" to the new directory.

You could try option #1 or #2 before starting Tomcat in a different user, and of course make sure the access permission of new jenkins home directory correct.

Upvotes: 1

Related Questions