Log rotation does not appear to be working

Bug #1079743 reported by David Shrewsbury
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libra
Fix Released
Critical
Andrew Hutchings

Bug Description

After running the latest Libra worker overnight, it seems that it stopped logging after several hours. I believe this may have been caused by the change made for bug # 1076765 that implements rolling logs.

My theory on what's happening:

* Process is started in daemon mode
* Log file gets created as the user starting the process (usually root)
* Process daemonizes and switches to a new user via --user option.
* New logging code attempts to manipulate the existing file but the user
does not have permission to do so, and an unhandled exception is being thrown.
* Logging is broken going forward

Tags: mgm worker
Revision history for this message
Andrew Hutchings (linuxjedi) wrote :

confirmed that is exactly what happens, good find, I wasn't running as root for my testing.

Fixing by changing ownership of file as we go into daemon mode

Changed in libra:
status: New → Triaged
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to libra (master)

Fix proposed to branch: master
Review: https://review.openstack.org/16324

Changed in libra:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to libra (master)

Reviewed: https://review.openstack.org/16324
Committed: http://github.com/stackforge/libra/commit/dbda529e81fbdd4952570f0762315ed1288433f0
Submitter: Jenkins
Branch: master

commit dbda529e81fbdd4952570f0762315ed1288433f0
Author: Andrew Hutchings <email address hidden>
Date: Fri Nov 16 18:50:23 2012 +0000

    Fix log rotation in daemon mode

    When daemon mode is started as root and the user is changed to a lower
    privilege user the log rotation breaks. This is because the log file is still
    owned by root.

    Now just before we switch user the log file user is changed to the new user.

    Fixes bug# 1079743

    Change-Id: Ia35e44bf9c891ce85a66e64989f97d3195520891

Changed in libra:
status: In Progress → Fix Committed
Changed in libra:
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.