cgred init script references wrong default file and uses bad options

Bug #825598 reported by Ryan Lovett
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libcgroup (Ubuntu)
Fix Released
High
Serge Hallyn
Lucid
Fix Released
Undecided
Unassigned
Maverick
Won't Fix
Undecided
Unassigned

Bug Description

=======================================
SRU Justification:
1. Impact: startup modifications specified in /etc/default/cgred.conf are ignored.
2. How bug was addressed: the cgred init file is fixed.
3. Patch: see attached debdiff.
4. TEST CASE: add 'LOG_FILE=/var/log/snood' to /etc/default/cgred.conf. It will be ignored.
5. Regression potential: if people have updated their /etc/default/cgred with errors, which had up to now been ignored, then those errors would now be seen.
=======================================

The /etc/init.d/cgred startup script looks for the file /etc/default/cgred.conf rather than /etc/default/cgred.

Additionally, the script makes no use of the DAEMON_OPTS variable found in the default file.

Lastly, the log file parameter as provided won't work. (the daemon exits with a usage error) One has to use the -f option instead of --log-file in order for the daemon to start.

It might be good to document LOG_FILE via a comment in /etc/default/cgred.

-if [ -f "/etc/default/cgred.conf" ] ; then
- . /etc/default/cgred.conf
- OPTIONS="$NODAEMON $LOG"
+if [ -f "/etc/default/cgred" ] ; then
+ . /etc/default/cgred
+ OPTIONS="$NODAEMON $LOG $DAEMON_OPTS"
  if [ -n "$LOG_FILE" ]; then
- OPTIONS="$OPTIONS --log-file=$LOG_FILE"
+ OPTIONS="$OPTIONS -f $LOG_FILE"
  fi

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Thanks for taking the time to report this bug.

It was fixed (inadvertently) in natty and oneiric with the switch to upstart. However the bugs are present in lucid and maverick.

Changed in libcgroup (Ubuntu):
status: New → In Progress
importance: Undecided → High
assignee: nobody → Serge Hallyn (serge-hallyn)
status: In Progress → Fix Released
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

(note the actual uploaded lucid fix does also add a comment for LOG_FILE, though that's not shown in the debdiff above)
(sadly, --logfile= would have worked, but '--log-file' is not recognized :)

description: updated
Revision history for this message
Ryan Lovett (ryan-spacecoaster) wrote : Re: [Bug 825598] Re: cgred init script references wrong default file and uses bad options

Great! Thanks very much for looking into this Serge and putting a solution
in place.

Ryan

Revision history for this message
Martin Pitt (pitti) wrote : Please test proposed package

Hello Ryan, or anyone else affected,

Accepted libcgroup into lucid-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 libcgroup (Ubuntu Lucid):
status: New → Fix Committed
tags: added: verification-needed
Revision history for this message
Martin Pitt (pitti) wrote :

Hello Ryan, or anyone else affected,

Accepted libcgroup into maverick-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 libcgroup (Ubuntu Maverick):
status: New → Fix Committed
tags: added: testcase
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote : Verification still needed

The fix for the this bug has been awaiting testing feedback in the -proposed repository for lucid for more than 90 days. Please test this fix and update the bug appropriately with the results. In the event that the fix for this bug is still not verified 15 days from now the package will be removed from the -proposed repository.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Verififed for lucid. (Maverick is EOL)

tags: added: verification-done
removed: verification-needed
Revision history for this message
Colin Watson (cjwatson) 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.

Changed in libcgroup (Ubuntu Maverick):
status: Fix Committed → Won't Fix
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libcgroup - 0.34-0ubuntu2.1

---------------
libcgroup (0.34-0ubuntu2.1) lucid-proposed; urgency=low

  * debian/patches/cgred-initscript-2.diff (LP: #825598)
    - source /etc/deafult/cgred, not cgred.conf
    - pull DAEMON_OPTS from defaults file into init script
    - --log-file is not a valid option. -f or --logfile is.
  * Show LOG_FILE in a comment in /etc/default/cgred.
 -- Serge Hallyn <email address hidden> Mon, 15 Aug 2011 13:47:54 -0500

Changed in libcgroup (Ubuntu Lucid):
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.