reload jenkins after log rotation

Bug #993065 reported by Jean-Baptiste Lallement
20
This bug affects 3 people
Affects Status Importance Assigned to Milestone
jenkins (Ubuntu)
Fix Released
Low
James Page
Precise
Fix Released
Medium
Jean-Baptiste Lallement

Bug Description

There is a postrotate action missing from /etc/logrotate.d/jenkins to reload jenkins after log rotation.
Currently jenkins log file stop updating after log rotation.

[Test Case]
1. Start Jenkins
2. Check that messages are logged in /var/log/jenkins/jenkins.log
3. Rotate the logs:
   $ sudo logrotate -f /etc/logrotate.d/jenkins
4. Check the the log has been rotated (a 0 byte jenkins.log file has been created)
5. Wait for a message to be logged by executing a job for example.

Result:
Without this fix: The log file /var/log/jenkins/jenkins.log remains empty
With this fix: A message is logged in /var/log/jenkins/jenkins.log

[Regression Potential]
None, since nothing is logged currently after log rotation.

ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: jenkins (not installed)
ProcVersionSignature: Ubuntu 3.2.0-24.37-generic 3.2.14
Uname: Linux 3.2.0-24-generic x86_64
ApportVersion: 2.0.1-0ubuntu7
Architecture: amd64
Date: Wed May 2 08:55:23 2012
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Beta amd64+mac (20120328)
ProcEnviron:
 TERM=xterm
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: jenkins
UpgradeStatus: No upgrade log present (probably fresh install)

Related branches

Revision history for this message
James Page (james-page) wrote :

Reload is not possible (not supported) but there is a logrotate option that will deal with this issue.

I'll work this into the next update I do.

Changed in jenkins (Ubuntu):
importance: Undecided → Low
assignee: nobody → James Page (james-page)
status: New → Triaged
Revision history for this message
C de-Avillez (hggdh2) wrote :

SIGALRM does the trick for our Jenkins; adjusting logrotate for a postrotate action of sending an ALRM bypasses the issue.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package jenkins - 1.447.2+dfsg-1

---------------
jenkins (1.447.2+dfsg-1) unstable; urgency=low

  * New upstream release.
  * Ensure jenkins keeps logging after log rotation (LP: #993065).
    - d/*.logrotate: Switch to copytruncate so jenkins does not lose
      the original file handle.

 -- James Page <email address hidden> Thu, 21 Jun 2012 09:47:58 +0100

Changed in jenkins (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Avalon (third-chance-deactivatedaccount) wrote :

Is that fix considered to be backported to precise?
Having unusable logs of Jenkins with the default config in the current LTS of Ubuntu seems to be pretty bad...

Revision history for this message
Colin Watson (cjwatson) wrote :

Canonical IS has reported being affected by this too.

Changed in jenkins (Ubuntu Precise):
importance: Undecided → Medium
status: New → Triaged
Changed in jenkins (Ubuntu Precise):
assignee: nobody → Jean-Baptiste Lallement (jibel)
status: Triaged → In Progress
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

The patch in lp:~jibel/ubuntu/precise/jenkins/LP993065_Keep_logging_after_rotation uses copytruncate so jenkins doesn't lose the original file handle. It is backported from Quantal.

description: updated
Revision history for this message
Martin Pitt (pitti) wrote :

SRU uploaded.

Changed in jenkins (Ubuntu Precise):
status: In Progress → Fix Committed
Revision history for this message
Brian Murray (brian-murray) wrote : Please test proposed package

Hello Jean-Baptiste, or anyone else affected,

Accepted jenkins into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/jenkins/1.424.6+dfsg-1ubuntu0.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, and change the tag from verification-needed to verification-done. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

tags: added: verification-needed
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

SRU verification for Precise:
I have reproduced the problem with jenkins 1.424.6+dfsg-1ubuntu0.1 in precise-updates and have verified that the version of jenkins 1.424.6+dfsg-1ubuntu0.2 in -proposed fixes the issue.

Marking as verification-done

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package jenkins - 1.424.6+dfsg-1ubuntu0.2

---------------
jenkins (1.424.6+dfsg-1ubuntu0.2) precise; urgency=low

  * Ensure jenkins keeps logging after log rotation (LP: #993065).
    - d/*.logrotate: Switch to copytruncate so jenkins does not lose the
      original file handle.
 -- Jean-Baptiste Lallement <email address hidden> Wed, 12 Jun 2013 19:24:47 +0200

Changed in jenkins (Ubuntu Precise):
status: Fix Committed → Fix Released
Revision history for this message
Scott Kitterman (kitterman) wrote : Update Released

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

Revision history for this message
Ohad (ohad-basan) wrote :

I have been to reproduce this problem on jenkins 1.627 running on ubuntu 14.04 LTS

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.