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

Debian package upgrade sets wrong user permissions if HUDSON_USER is not hudson (default)

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Major
    • Resolution: Fixed
    • core
    • None
    • Linux 2.6.31-19-server #56-Ubuntu SMP Thu Jan 28 03:40:48 UTC 2010 x86_64 GNU/Linux

    Description

      We have a setup where the user is not hudson (default) but build:

      Extract from /etc/default/hudson

      # user id to be invoked as (otherwise will run as root; not wise!) 
      HUDSON_USER=build
      

      After hudson package upgrade (aptitude) I noticed that the permission in the following directory is set to hudson:adm again instead of ${HUDSON_USER}:

      /var/lib/hudson <- hudson configuration
      /var/run/hudson/war <- web root

      This causes hudson to not run properly.
      The user permissions should be changed to the user specified in HUDSON_USER.

      Possible fix in /trunk/hudson/main/debian/hudson.postinst:

      • Read HUDSON_USER from /etc/default/hudson or maybe hudson.default and set the permission accordingly

      I'm not sure how to handle the group permission. It could be fixed to adm (current solution) or a new environment variable HUDSON_GROUP could be added.

      A completely different approach could be to don't touch permission after upgrade at all.

      A recent change in this area (JENKINS-4047) leaves the jobs directory untouched. But this doesn't fix the current problem.

      Attachments

        Issue Links

          Activity

            I'm curious how other debian packages handle this kind of problem.
            A relatively easy workaround is not to use /var/lib/hudson if you are using a different user.

            I'm tempted to mark this issue as "Won't Fix", but if there's any debian expert, I'd love to hear your opinion.

            kohsuke Kohsuke Kawaguchi added a comment - I'm curious how other debian packages handle this kind of problem. A relatively easy workaround is not to use /var/lib/hudson if you are using a different user. I'm tempted to mark this issue as "Won't Fix", but if there's any debian expert, I'd love to hear your opinion.
            blueyed Daniel Hahler added a comment -

            I've created a pull request, which should fix this (for JENKINS_USER - it does not add a new variable JENKINS_GROUP):
            https://github.com/jenkinsci/jenkins/pull/308

            blueyed Daniel Hahler added a comment - I've created a pull request, which should fix this (for JENKINS_USER - it does not add a new variable JENKINS_GROUP): https://github.com/jenkinsci/jenkins/pull/308

            Code changed in jenkins
            User: Daniel Hahler
            Path:
            changelog.html
            debian/debian/jenkins.postinst
            http://jenkins-ci.org/commit/jenkins/8d1cda0edd31764f613f1ab100205c9d9a7faac9
            Log:
            JENKINS-5771 Use $JENKINS_USER in Debian postinst.

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Hahler Path: changelog.html debian/debian/jenkins.postinst http://jenkins-ci.org/commit/jenkins/8d1cda0edd31764f613f1ab100205c9d9a7faac9 Log: JENKINS-5771 Use $JENKINS_USER in Debian postinst.
            dogfood dogfood added a comment -

            Integrated in jenkins_main_trunk #1332
            JENKINS-5771 Use $JENKINS_USER in Debian postinst.

            Kohsuke Kawaguchi : 8d1cda0edd31764f613f1ab100205c9d9a7faac9
            Files :

            • debian/debian/jenkins.postinst
            • changelog.html
            dogfood dogfood added a comment - Integrated in jenkins_main_trunk #1332 JENKINS-5771 Use $JENKINS_USER in Debian postinst. Kohsuke Kawaguchi : 8d1cda0edd31764f613f1ab100205c9d9a7faac9 Files : debian/debian/jenkins.postinst changelog.html

            The above commit fixes this problem.

            kohsuke Kohsuke Kawaguchi added a comment - The above commit fixes this problem.

            Code changed in jenkins
            User: Daniel Hahler
            Path:
            debian/jenkins.postinst
            http://jenkins-ci.org/commit/packaging/cdb977643ff21c0840608cbeea1bb252cbb14ee1
            Log:
            JENKINS-5771 Use $JENKINS_USER in Debian postinst.

            Originally-From: jenkins-ci.org/commit/core/8d1cda0edd31764f613f1ab100205c9d9a7faac9

            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Hahler Path: debian/jenkins.postinst http://jenkins-ci.org/commit/packaging/cdb977643ff21c0840608cbeea1bb252cbb14ee1 Log: JENKINS-5771 Use $JENKINS_USER in Debian postinst. Originally-From: jenkins-ci.org/commit/core/8d1cda0edd31764f613f1ab100205c9d9a7faac9

            People

              Unassigned Unassigned
              andisch andisch
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: