Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-9399

Jenkins installs as a launch agent, not as launch daemon

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • core
    • None
    • Mac OS X 10.6.7 (probably all OS X 10 versions)

      Mac installer drops the org.jenkins-ci.plist file into /Library/LaunchAgents, which means it is loaded when every user logs in and it will run as that respective user. The permissions of JENKINS_HOME will probably cause Jenkins to fail to run for other users except the one who was the first to successfully run Jenkins. (Launch agents always run as the user who logs on, so they cannot setuid to daemon user even if the plist file so specifies.)

      Expected: the org.jenkins-ci.plist file would be installed into /Library/LaunchDaemons. This would cause only one instance of Jenkins to run on the host. It would also start after reboot even if no user logs on. It would also run Jenkins as daemon user, like specified in the plist file.

          [JENKINS-9399] Jenkins installs as a launch agent, not as launch daemon

          Code changed in jenkins
          User: Kohsuke Kawaguchi
          Path:
          changelog.html
          http://jenkins-ci.org/commit/jenkins/1e308c2a7457c5e9d5929b1de39328e2e27ab3b8
          Log:
          [FIXED JENKINS-9398 JENKINS-9399]
          These issues are fixed with pull request #166 that we just merged.

          Compare: https://github.com/jenkinsci/jenkins/compare/89bd7cd...1e308c2

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: changelog.html http://jenkins-ci.org/commit/jenkins/1e308c2a7457c5e9d5929b1de39328e2e27ab3b8 Log: [FIXED JENKINS-9398 JENKINS-9399] These issues are fixed with pull request #166 that we just merged. Compare: https://github.com/jenkinsci/jenkins/compare/89bd7cd...1e308c2

          marking as fixed.

          Kohsuke Kawaguchi added a comment - marking as fixed.

          dogfood added a comment -

          Integrated in jenkins_main_trunk #910
          [FIXED JENKINS-9398 JENKINS-9399]

          Kohsuke Kawaguchi : 1e308c2a7457c5e9d5929b1de39328e2e27ab3b8
          Files :

          • changelog.html

          dogfood added a comment - Integrated in jenkins_main_trunk #910 [FIXED JENKINS-9398 JENKINS-9399] Kohsuke Kawaguchi : 1e308c2a7457c5e9d5929b1de39328e2e27ab3b8 Files : changelog.html

          Sami Tikka added a comment -

          Still installs as launch agent when using latest 1.418 installer.

          Sami Tikka added a comment - Still installs as launch agent when using latest 1.418 installer.

          Will Ross added a comment -

          The change was merged in for 1.419. The installer should also try to remove the old launch agent when the launch daemon is installed.

          Will Ross added a comment - The change was merged in for 1.419. The installer should also try to remove the old launch agent when the launch daemon is installed.

          Sami Tikka added a comment -

          Ok, I have verified it. Sorry, I apparently do not understand how the release process goes. I was assuming the fix would have been in the next release that came out after the merge.

          Sami Tikka added a comment - Ok, I have verified it. Sorry, I apparently do not understand how the release process goes. I was assuming the fix would have been in the next release that came out after the merge.

          Code changed in jenkins
          User: Kohsuke Kawaguchi
          Path:
          changelog.html
          http://jenkins-ci.org/commit/jenkins/1e308c2a7457c5e9d5929b1de39328e2e27ab3b8
          Log:
          [FIXED JENKINS-9398 JENKINS-9399]
          These issues are fixed with pull request #166 that we just merged.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: changelog.html http://jenkins-ci.org/commit/jenkins/1e308c2a7457c5e9d5929b1de39328e2e27ab3b8 Log: [FIXED JENKINS-9398 JENKINS-9399] These issues are fixed with pull request #166 that we just merged.

          Laird Nelson added a comment -

          Hello; I noticed that running Jenkins as user daemon means that he cannot create the .m2 directory in /var/root (his home directory on the Mac).

          If you do this:

          sudo mkdir -p /var/root/.m2
          

          ...and then:

          sudo chmod a+rwx /var/root/.m2
          

          ...Jenkins can STILL not write to that directory (?!).

          Anyhow, I've found that user daemon just doesn't work well. Perhaps someone with more system administrator experience could explain how it is that user daemon cannot read or write to a directory that has been chmod}}ded to {{777.

          Laird Nelson added a comment - Hello; I noticed that running Jenkins as user daemon means that he cannot create the .m2 directory in /var/root (his home directory on the Mac). If you do this: sudo mkdir -p /var/root/.m2 ...and then: sudo chmod a+rwx /var/root/.m2 ...Jenkins can STILL not write to that directory (?!). Anyhow, I've found that user daemon just doesn't work well. Perhaps someone with more system administrator experience could explain how it is that user daemon cannot read or write to a directory that has been chmod}}ded to {{777 .

          Sami Tikka added a comment -

          It is not immediately obvious to me why the user daemon cannot write to a directory that has write permission for everyone. Possibly there are security mechanisms at work which are more sophisticated than standard unix permissions.

          My way around the problem (e.g. when compiling Jenkins itself) is to add this to the maven options:

          -Duser.dir=/Users/Shared/Jenkins -Duser.home=/Users/Shared/Jenkins
          

          Sami Tikka added a comment - It is not immediately obvious to me why the user daemon cannot write to a directory that has write permission for everyone. Possibly there are security mechanisms at work which are more sophisticated than standard unix permissions. My way around the problem (e.g. when compiling Jenkins itself) is to add this to the maven options: -Duser.dir=/Users/Shared/Jenkins -Duser.home=/Users/Shared/Jenkins

          Code changed in jenkins
          User: Kohsuke Kawaguchi
          Path:
          changelog.html
          http://jenkins-ci.org/commit/jenkins/1e308c2a7457c5e9d5929b1de39328e2e27ab3b8
          Log:
          [FIXED JENKINS-9398 JENKINS-9399]
          These issues are fixed with pull request #166 that we just merged.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: changelog.html http://jenkins-ci.org/commit/jenkins/1e308c2a7457c5e9d5929b1de39328e2e27ab3b8 Log: [FIXED JENKINS-9398 JENKINS-9399] These issues are fixed with pull request #166 that we just merged.

            Unassigned Unassigned
            sti Sami Tikka
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: