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

Add a logrotate definition to the Jenkins Debian package definition (similar to Apache, cron-apt, aptitude and apt)

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Trivial Trivial
    • core
    • None
    • Debian Linux i386 and AMD64

      The Debian package is a great convenience for me. It configures a user, registers the daemon, and makes installation and upgrade wonderful on Debian. I was surprised when I discovered /var/log/jenkins/jenkins.log with over 2 GB of log information on my machine.

      Other Debian packages seem to have some ability to configure their logrotate settings automatically (like Apache, apt, ppp, etc.). It would be nice if Jenkins could do the same.

          [JENKINS-8641] Add a logrotate definition to the Jenkins Debian package definition (similar to Apache, cron-apt, aptitude and apt)

          We use daemon(1) to turn Jenkins into a daemon, but it doesn't appear to support log reopening via signal. So unfortunately this is bit tricky to get right.

          I guess we should let Jenkins directly write to a log file with --logfile, since Jenkins supports log reopening via SIGALRM. Doing this requires we capture PID of the Java process, not just the daemon process.

          Kohsuke Kawaguchi added a comment - We use daemon(1) to turn Jenkins into a daemon, but it doesn't appear to support log reopening via signal. So unfortunately this is bit tricky to get right. I guess we should let Jenkins directly write to a log file with --logfile, since Jenkins supports log reopening via SIGALRM. Doing this requires we capture PID of the Java process, not just the daemon process.

          Mark Waite added a comment -

          I thought you could avoid the hassle of closing and reopening the log by using the copytruncate setting.

          I use this configuration:

          /var/log/jenkins/jenkins.log
          {
          daily
          copytruncate
          missingok
          compress
          delaycompress
          notifempty
          rotate 8
          }

          Mark Waite added a comment - I thought you could avoid the hassle of closing and reopening the log by using the copytruncate setting. I use this configuration: /var/log/jenkins/jenkins.log { daily copytruncate missingok compress delaycompress notifempty rotate 8 }

          René Moser added a comment -

          René Moser added a comment - Patch is in queue https://github.com/jenkinsci/jenkins/pull/106

          Code changed in jenkins
          User: Kohsuke Kawaguchi
          Path:
          debian/debian/jenkins.logrotate
          debian/debian/rules
          http://jenkins-ci.org/commit/jenkins/92aa65da2ebaeff58f4d33b8f0a067510043a20f
          Log:
          Merge pull request #109 from resmo/JENKINS-8641

          JENKINS-8641: Added a logrotate definition to the Debian/Ubuntu package.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: debian/debian/jenkins.logrotate debian/debian/rules http://jenkins-ci.org/commit/jenkins/92aa65da2ebaeff58f4d33b8f0a067510043a20f Log: Merge pull request #109 from resmo/ JENKINS-8641 JENKINS-8641 : Added a logrotate definition to the Debian/Ubuntu package.

          Code changed in jenkins
          User: Kohsuke Kawaguchi
          Path:
          changelog.html
          http://jenkins-ci.org/commit/jenkins/9e69d9a95b7197a39d34c0c5f9c23c64c589f5b5
          Log:
          recording JENKINS-8641 fix

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: changelog.html http://jenkins-ci.org/commit/jenkins/9e69d9a95b7197a39d34c0c5f9c23c64c589f5b5 Log: recording JENKINS-8641 fix

          fixed in changelog but issue not closed ?

          Arnaud Héritier added a comment - fixed in changelog but issue not closed ?

          Mark Waite added a comment -

          New file /etc/logrotate.d/jenkins appeared in the 1.413 build.

          Mark Waite added a comment - New file /etc/logrotate.d/jenkins appeared in the 1.413 build.

          Mark Waite added a comment -

          Works as I had hoped. I was a little surprised that it is retaining logs for a full year (rotate 52), but that probably better fits the needs of those who retain data for longer than I retain it.

          Mark Waite added a comment - Works as I had hoped. I was a little surprised that it is retaining logs for a full year (rotate 52), but that probably better fits the needs of those who retain data for longer than I retain it.

          Code changed in jenkins
          User: René Moser
          Path:
          debian/debian/jenkins.logrotate
          debian/debian/rules
          http://jenkins-ci.org/commit/jenkins/8b09a585243287b6cb5270a0a1447995f1fc3dff
          Log:
          JENKINS-8641: Added a logrotate definition to the Debian/Ubuntu package.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: René Moser Path: debian/debian/jenkins.logrotate debian/debian/rules http://jenkins-ci.org/commit/jenkins/8b09a585243287b6cb5270a0a1447995f1fc3dff Log: JENKINS-8641 : Added a logrotate definition to the Debian/Ubuntu package.

          Code changed in jenkins
          User: Kohsuke Kawaguchi
          Path:
          debian/debian/jenkins.logrotate
          debian/debian/rules
          http://jenkins-ci.org/commit/jenkins/92aa65da2ebaeff58f4d33b8f0a067510043a20f
          Log:
          Merge pull request #109 from resmo/JENKINS-8641

          JENKINS-8641: Added a logrotate definition to the Debian/Ubuntu package.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: debian/debian/jenkins.logrotate debian/debian/rules http://jenkins-ci.org/commit/jenkins/92aa65da2ebaeff58f4d33b8f0a067510043a20f Log: Merge pull request #109 from resmo/ JENKINS-8641 JENKINS-8641 : Added a logrotate definition to the Debian/Ubuntu package.

          Code changed in jenkins
          User: Kohsuke Kawaguchi
          Path:
          changelog.html
          http://jenkins-ci.org/commit/jenkins/9e69d9a95b7197a39d34c0c5f9c23c64c589f5b5
          Log:
          recording JENKINS-8641 fix

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: changelog.html http://jenkins-ci.org/commit/jenkins/9e69d9a95b7197a39d34c0c5f9c23c64c589f5b5 Log: recording JENKINS-8641 fix

          Code changed in jenkins
          User: René Moser
          Path:
          debian/debian/jenkins.logrotate
          debian/debian/rules
          http://jenkins-ci.org/commit/jenkins/8b09a585243287b6cb5270a0a1447995f1fc3dff
          Log:
          JENKINS-8641: Added a logrotate definition to the Debian/Ubuntu package.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: René Moser Path: debian/debian/jenkins.logrotate debian/debian/rules http://jenkins-ci.org/commit/jenkins/8b09a585243287b6cb5270a0a1447995f1fc3dff Log: JENKINS-8641 : Added a logrotate definition to the Debian/Ubuntu package.

          Code changed in jenkins
          User: Kohsuke Kawaguchi
          Path:
          debian/debian/jenkins.logrotate
          debian/debian/rules
          http://jenkins-ci.org/commit/jenkins/92aa65da2ebaeff58f4d33b8f0a067510043a20f
          Log:
          Merge pull request #109 from resmo/JENKINS-8641

          JENKINS-8641: Added a logrotate definition to the Debian/Ubuntu package.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: debian/debian/jenkins.logrotate debian/debian/rules http://jenkins-ci.org/commit/jenkins/92aa65da2ebaeff58f4d33b8f0a067510043a20f Log: Merge pull request #109 from resmo/ JENKINS-8641 JENKINS-8641 : Added a logrotate definition to the Debian/Ubuntu package.

          Code changed in jenkins
          User: Kohsuke Kawaguchi
          Path:
          changelog.html
          http://jenkins-ci.org/commit/jenkins/9e69d9a95b7197a39d34c0c5f9c23c64c589f5b5
          Log:
          recording JENKINS-8641 fix

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: changelog.html http://jenkins-ci.org/commit/jenkins/9e69d9a95b7197a39d34c0c5f9c23c64c589f5b5 Log: recording JENKINS-8641 fix

          Code changed in jenkins
          User: René Moser
          Path:
          debian/jenkins.logrotate
          debian/rules
          http://jenkins-ci.org/commit/packaging/e4cc488c7222de80bb8505e016ee5caede4300e2
          Log:
          JENKINS-8641: Added a logrotate definition to the Debian/Ubuntu package.

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

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: René Moser Path: debian/jenkins.logrotate debian/rules http://jenkins-ci.org/commit/packaging/e4cc488c7222de80bb8505e016ee5caede4300e2 Log: JENKINS-8641 : Added a logrotate definition to the Debian/Ubuntu package. Originally-From: jenkins-ci.org/commit/core/8b09a585243287b6cb5270a0a1447995f1fc3dff

          Code changed in jenkins
          User: Kohsuke Kawaguchi
          Path:
          debian/jenkins.logrotate
          debian/rules
          http://jenkins-ci.org/commit/packaging/195bbb8c05e2ce1b96a4e3c1e45c1bc8077af4a8
          Log:
          Merge pull request #109 from resmo/JENKINS-8641

          JENKINS-8641: Added a logrotate definition to the Debian/Ubuntu package.
          Originally-From: jenkins-ci.org/commit/core/92aa65da2ebaeff58f4d33b8f0a067510043a20f

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: debian/jenkins.logrotate debian/rules http://jenkins-ci.org/commit/packaging/195bbb8c05e2ce1b96a4e3c1e45c1bc8077af4a8 Log: Merge pull request #109 from resmo/ JENKINS-8641 JENKINS-8641 : Added a logrotate definition to the Debian/Ubuntu package. Originally-From: jenkins-ci.org/commit/core/92aa65da2ebaeff58f4d33b8f0a067510043a20f

          Usually logrotate needs to signal the process that it needs to use the new log file.  I.e. close and reopen so that it's using the newly created log file created by `logrotate`.  I don't see that here.

          So how does Jenkins know to stop using the rotated log and use the/a new one?

          Brian J Murrell added a comment - Usually logrotate needs to signal the process that it needs to use the new log file.  I.e. close and reopen so that it's using the newly created log file created by `logrotate`.  I don't see that here. So how does Jenkins know to stop using the rotated log and use the/a new one?

            resmo René Moser
            MarkEWaite MarkEWaite
            Votes:
            4 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: