Image store proxy's logrotate config triggers an email every day

Bug #460234 reported by Loïc Minier
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
image-store-proxy (Ubuntu)
Fix Released
Low
Mathias Gug
Karmic
Fix Released
Low
Mathias Gug

Bug Description

Hi

Got an email from cron this morning:
/etc/cron.daily/logrotate:
 * Restarting Image Store Proxy image-store-proxy
   ...done.

This is due to /etc/logrotate.d/image-store-proxy doing:
  postrotate
  /etc/init.d/image-store-proxy force-reload
  endscript

I suggest only reloading if the proxy is running and redirecting non-error output to /dev/null like apache2 does:
        postrotate
                if [ -f "`. /etc/apache2/envvars ; echo ${APACHE_PID_FILE:-/var/run/apache2.pid}`" ]; then
                        /etc/init.d/apache2 reload > /dev/null
                fi
        endscript

Thanks

ProblemType: Bug
Architecture: amd64
Date: Sun Oct 25 08:19:51 2009
DistroRelease: Ubuntu 9.10
Package: python-image-store-proxy 1.0.4-0ubuntu1
PackageArchitecture: all
ProcEnviron:
 SHELL=/bin/zsh
 PATH=(custom, user)
 LANG=fr_FR.UTF-8
ProcVersionSignature: Ubuntu 2.6.31-11.38-generic
SourcePackage: image-store-proxy
Uname: Linux 2.6.31-11-generic x86_64

==========
Karmic SRU

Impact:
When image-store-proxy are rotated the daemon is restarted which prints a message on stdout. As consequence an email is automatically generated everytime log are rotated.

How the problem has been addressed:
The postrotate script checks whether the daemon is running. If so it restarts it with std out redirected to /dev/null.

TESTCASE:
1. Install image-store-proxy.
2. Force a log rotation:

   sudo /usr/sbin/logrotate /etc/logrotate.conf -f

Before the upgrade:

A message should be printed on standard output:
 * Restarting Image Store Proxy image-store-proxy

   ...done.

After the upgrade there shouldn't be any message printed. The image-store-proxy daemon should have been restarted (new pid).

Regression potential:
The logic used for the fix is similar to the one used in the apache2 package. If the logic fails image-store-proxy daemon will keep writing to existing log file which will be eventually deleted.

==========

Revision history for this message
Loïc Minier (lool) wrote :
Changed in image-store-proxy (Ubuntu):
importance: Undecided → Low
milestone: none → ubuntu-9.10
Revision history for this message
Loïc Minier (lool) wrote :

Would be nice to fix for final, but there are probably higher priority things to fix, please move to -updates or remove the karmic task if you can't address it as a SRU either.

Changed in image-store-proxy (Ubuntu):
assignee: nobody → Canonical Server Team (canonical-server)
Loïc Minier (lool)
summary: - Image story's logrotate config triggers an email every day
+ Image store proxy's logrotate config triggers an email every day
Matt Zimmerman (mdz)
Changed in image-store-proxy (Ubuntu):
milestone: ubuntu-9.10 → karmic-updates
Changed in image-store-proxy (Ubuntu Karmic):
status: New → Won't Fix
status: Won't Fix → Triaged
assignee: Canonical Server Team (canonical-server) → Mathias Gug (mathiaz)
Mathias Gug (mathiaz)
tags: added: uec
Mathias Gug (mathiaz)
description: updated
Changed in image-store-proxy (Ubuntu):
milestone: karmic-updates → none
status: New → In Progress
Changed in image-store-proxy (Ubuntu Karmic):
status: Triaged → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package image-store-proxy - 1.0.4-0ubuntu2

---------------
image-store-proxy (1.0.4-0ubuntu2) lucid; urgency=low

  * Silence image-store-proxy restart when logs are rotated (LP: #460234).
 -- Mathias Gug <email address hidden> Fri, 13 Nov 2009 17:12:11 -0500

Changed in image-store-proxy (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Accepted image-store-proxy into karmic-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in image-store-proxy (Ubuntu Karmic):
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
Steve Beattie (sbeattie) wrote :

I am able to reproduce the generated output when rotating logs with the version of python-image-store-proxy in karmic, 1.0.4-0ubuntu1, and can confirm that the version in karmic-proposed, 1.0.4-0ubuntu1.1, fixes the issue. I don't have a eucalyptus setup, so I am unable to test the package in that context for regressions; however, running the unit tests for the package didn't show any regressions.

Marking verification-done, thanks.

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

This bug was fixed in the package image-store-proxy - 1.0.4-0ubuntu1.1

---------------
image-store-proxy (1.0.4-0ubuntu1.1) karmic-proposed; urgency=low

  * Silence image-store-proxy restart when logs are rotated (LP: #460234).
 -- Mathias Gug <email address hidden> Fri, 13 Nov 2009 17:12:51 -0500

Changed in image-store-proxy (Ubuntu Karmic):
status: Fix Committed → Fix Released
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.