Installing Jenkins - It is not possible to create a home directory, despite its existence and writeability

I am trying to install Jenkins on a Tomcat 7 container.

When I try to open a Jenkins web application, I get the following error:

Unable to create the home directory '/home/myuser/jenkins/work'. This is most likely a permission problem. To change the home directory, use JENKINS_HOME environment variable or set the JENKINS_HOME system property. See Container-specific documentation for more details of how to do this. 

Before starting Tomcat, I did chmod uog+rwx /home/myuser/jenkins . So, I suppose that Jenkins should be able to create a subdirectory there.

But obviously this is not possible.

How can I fix this problem?

Update 1:

lt -lt returns

drwxrwxrwx 2 root ec2-user 4096 Jun 23 10:25 jenkins

for /home/myuser/jenkins . /home/myuser/jenkins/work does not exist because Jenkins must create it.

Update 2: Just tried creating the work directory and running chmod uog+rwx on it. It did not help.

Update 3 : Additional Information:

  • I need Jenkins to
    • Perform lengthy tests at night (fast unit tests run before each mvn install , slow tests run every night) and
    • over time, maintain software quality indicators (checkstyle, PMD, FindBugs, unit test, etc.).
  • I have only one machine for this, and the Tomcat7 container is already installed there.
  • At the moment, I do not want to invest extra money in the purchase of new cars.
  • The machine with the Tomcat7 container (and where I want to install Jenkins) is the Amazon EC2 micro-const (OS version is given below).

    $ cat / etc / * - LSB_VERSION release = base-4.0-amd64: base 4.0-noarch: core-4.0-amd64: core-4.0-noarch: print-4.0-amd64: print-4.0-noarch Amazon Linux AMI Release 2013.03

Update 4 (06/29/2013 13:34 MSK): The yum list output does not contain the Jenkins / Hudson package.

+4
source share
4 answers

If Tomcat works as a separate user, you will need to grant permission for this user to execute for your home directory - either by granting it to everyone, or by creating a group specifically for you and the tomcat user.

(UPDATE) More specifically: you say you have already done chmod uog+rwx /home/myuser/jenkins , if Tomcat does not work asl 'myuser', it also needs permission to run in / home and in / home / myuser to have ability to open / home / myuser / jenkins. If you are not picky about other users of the system that opens your homedir, you can do this: chmod a+x /home/myuser . (I assume the permissions for / home are already fine)

If you use tomcat as "myuser", the permissions on the file system look fine, but the Tomcat permission system itself can be a problem, since web applications are not allowed to touch the file system if the default settings for the security manager are enabled.

See: https://wiki.jenkins-ci.org/display/JENKINS/Tomcat

You have not indicated more about your fine-tuning Tomcat / OS anymore, so I cannot give accurate data, but a quick way to find out if this is not a security problem is to provide AllPermission for you webapp. If you are not working in a safe environment, it is recommended that you use this only as a test and set only the really necessary permissions later.

+5
source

It seems like the problem may be that jenkins cannot see /home/myuser and therefore it cannot access the jenkins folder inside this (even if it has write permissions in /home/myuser/jenkins , I believe that it cannot read /home/myuser causing the problem).

Try the command below and then see if Jenkins works after that:

 chmod +r /home/myuser 
+1
source

run these three commands cd / usr / share / tomcat7

sudo mkdir.jenkins

sudo chown tomcat7: nogroup.jenkins

https://seleniumwithjavapython.wordpress.com/home/jenkins-installation/

+1
source

@robjohncox Yes - drwx ------ 5 myuser myuser 4096 Jun 23 10:25 myuser

you must add + x to this directory to enable jenkins to access its contents, or rather, the whole path should have + x for everyone.

Also, what commands did you use to move the original dir from the default value - a possible error is out there somewhere. Greetings, Peter

0
source

Source: https://habr.com/ru/post/1487701/


All Articles