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

RPM post-install should not do a "chown -R ${JENKINS_USER:-jenkins} ${JENKINS_HOME:-/var/lib/jenkins}"

      The jenkins-1.565-1.1 RPM contains a post-install script with performs the following:

      # Ensure the right ownership on files
      . /etc/sysconfig/jenkins
      chown -R ${JENKINS_USER:-jenkins} /var/log/jenkins
      chown -R ${JENKINS_USER:-jenkins} ${JENKINS_HOME:-/var/lib/jenkins}
      

      These chowns can take a very long time on systems with lots of files. A couple of our Jenkins boxes have thousands of files in a the /var/lib/jenkins/workspace directory (which itself is a network mount), which means this chown takes many minutes to complete (like ~15 minutes) and actually changes the ownership of no files. This holds up package deployment unnecessarily.

      I propose that either these chowns be removed entirely (the RPM spec sets the ownership of things the RPM puts down), or better yet that they're restricted to specific files.

          [JENKINS-23273] RPM post-install should not do a "chown -R ${JENKINS_USER:-jenkins} ${JENKINS_HOME:-/var/lib/jenkins}"

          Code changed in jenkins
          User: Vojtěch-Zweibrücken-Šafařík
          Path:
          rpm/build/SPECS/jenkins.spec
          http://jenkins-ci.org/commit/packaging/d6f9ba991306e1b5f5e87315debd7dc0c66fc5b1
          Log:
          JENKINS-23273 Do a recursive chown only when needed

          • When the owner of files and configured JENKINS_USER are not the same we
            need a recursive chown
          • If the owner and the configured JENKINS_USER are the same but not the
            default chown only the folders
          • In the default case (owner, JENKINS_USER and %name being the same) do
            nothing

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Vojtěch-Zweibrücken-Šafařík Path: rpm/build/SPECS/jenkins.spec http://jenkins-ci.org/commit/packaging/d6f9ba991306e1b5f5e87315debd7dc0c66fc5b1 Log: JENKINS-23273 Do a recursive chown only when needed When the owner of files and configured JENKINS_USER are not the same we need a recursive chown If the owner and the configured JENKINS_USER are the same but not the default chown only the folders In the default case (owner, JENKINS_USER and %name being the same) do nothing

          Code changed in jenkins
          User: Vojtěch-Zweibrücken-Šafařík
          Path:
          rpm/build/SPECS/jenkins.spec
          http://jenkins-ci.org/commit/packaging/5ee2ae85ebc6daf89235e28965fcae65d5dd2f79
          Log:
          JENKINS-23273 Addressing feedback

          • Added logging
          • Removed unneeded touch
          • Used stat --format=%U instead of ls -ld
          • Created a bash function to avoid duplication

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Vojtěch-Zweibrücken-Šafařík Path: rpm/build/SPECS/jenkins.spec http://jenkins-ci.org/commit/packaging/5ee2ae85ebc6daf89235e28965fcae65d5dd2f79 Log: JENKINS-23273 Addressing feedback Added logging Removed unneeded touch Used stat --format=%U instead of ls -ld Created a bash function to avoid duplication

          Code changed in jenkins
          User: Vojtěch-Zweibrücken-Šafařík
          Path:
          rpm/build/SPECS/jenkins.spec
          http://jenkins-ci.org/commit/packaging/d6732acca6e360e6a45c3a05d3db175c04697fb5
          Log:
          JENKINS-23273 Fix typo

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Vojtěch-Zweibrücken-Šafařík Path: rpm/build/SPECS/jenkins.spec http://jenkins-ci.org/commit/packaging/d6732acca6e360e6a45c3a05d3db175c04697fb5 Log: JENKINS-23273 Fix typo

          Code changed in jenkins
          User: Raul Arabaolaza
          Path:
          rpm/build/SPECS/jenkins.spec
          http://jenkins-ci.org/commit/packaging/322d0ee11dd26e369c4590fb389b4a411ed63840
          Log:
          JENKINS-23273 Make some variables space safe by quoting them

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Raul Arabaolaza Path: rpm/build/SPECS/jenkins.spec http://jenkins-ci.org/commit/packaging/322d0ee11dd26e369c4590fb389b4a411ed63840 Log: JENKINS-23273 Make some variables space safe by quoting them

          Code changed in jenkins
          User: Sam Van Oort
          Path:
          rpm/build/SPECS/jenkins.spec
          http://jenkins-ci.org/commit/packaging/eb7579d4d39466ade20f0405ce1b0e2a28d764de
          Log:
          Merge pull request #87 from raul-arabaolaza/JENKINS-23273

          JENKINS-23273 RPM post-install should not do a "chown R ${JENKINS_USER:-jenkins} ${JENKINS_HOME:/var/lib/jenkins}"

          Compare: https://github.com/jenkinsci/packaging/compare/2206ee9f38e9...eb7579d4d394

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Sam Van Oort Path: rpm/build/SPECS/jenkins.spec http://jenkins-ci.org/commit/packaging/eb7579d4d39466ade20f0405ce1b0e2a28d764de Log: Merge pull request #87 from raul-arabaolaza/ JENKINS-23273 JENKINS-23273 RPM post-install should not do a "chown R ${JENKINS_USER:-jenkins} ${JENKINS_HOME: /var/lib/jenkins}" Compare: https://github.com/jenkinsci/packaging/compare/2206ee9f38e9...eb7579d4d394

          Ben Hines added a comment -

          This change was never in the release notes. Was it released? 

          Ben Hines added a comment - This change was never in the release notes. Was it released? 

          Oleg Nenashev added a comment -

          benh57 It was (around 2.53). I will make sure changelog is updated. Packaging is asynchronous, so it is hard to track changes in the core. I also want to start a developer ML thread for it

          Oleg Nenashev added a comment - benh57 It was (around 2.53). I will make sure changelog is updated. Packaging is asynchronous, so it is hard to track changes in the core. I also want to start a developer ML thread for it

          Code changed in jenkins
          User: Oleg Nenashev
          Path:
          content/_data/changelogs/weekly.yml
          http://jenkins-ci.org/commit/jenkins.io/bd7e8598e4b85d84286ded5f2e6d71d08d8531ee
          Log:
          Add missing changelog entries for JENKINS-23273 and JENKINS-40693

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Oleg Nenashev Path: content/_data/changelogs/weekly.yml http://jenkins-ci.org/commit/jenkins.io/bd7e8598e4b85d84286ded5f2e6d71d08d8531ee Log: Add missing changelog entries for JENKINS-23273 and JENKINS-40693

          Code changed in jenkins
          User: Daniel Beck
          Path:
          content/_data/changelogs/weekly.yml
          http://jenkins-ci.org/commit/jenkins.io/d6c1369d8ebcdff4a9f126097ecc6a7c30ea1d86
          Log:
          Merge pull request #921 from oleg-nenashev/changelog/missing-entries

          Add missing changelog entries for JENKINS-23273 and JENKINS-40693

          Compare: https://github.com/jenkins-infra/jenkins.io/compare/14212ab18dfd...d6c1369d8ebc

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Beck Path: content/_data/changelogs/weekly.yml http://jenkins-ci.org/commit/jenkins.io/d6c1369d8ebcdff4a9f126097ecc6a7c30ea1d86 Log: Merge pull request #921 from oleg-nenashev/changelog/missing-entries Add missing changelog entries for JENKINS-23273 and JENKINS-40693 Compare: https://github.com/jenkins-infra/jenkins.io/compare/14212ab18dfd...d6c1369d8ebc

          Code changed in jenkins
          User: Daniel Beck
          Path:
          content/_data/changelogs/lts.yml
          content/_data/changelogs/weekly.yml
          content/doc/upgrade-guide/2.60.adoc
          http://jenkins-ci.org/commit/jenkins.io/800435b6892e68f259f9c6ecbc54e79b1798c656
          Log:
          Mention JENKINS-23273, minor upgrade guide changes

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Daniel Beck Path: content/_data/changelogs/lts.yml content/_data/changelogs/weekly.yml content/doc/upgrade-guide/2.60.adoc http://jenkins-ci.org/commit/jenkins.io/800435b6892e68f259f9c6ecbc54e79b1798c656 Log: Mention JENKINS-23273 , minor upgrade guide changes

            rarabaolaza Raul Arabaolaza
            coofercat Ralph Bolton
            Votes:
            13 Vote for this issue
            Watchers:
            24 Start watching this issue

              Created:
              Updated:
              Resolved: