broken bmc-watchdog init script/logrotate config

Bug #594827 reported by Robert Hardy on 2010-06-15
24
This bug affects 3 people
Affects Status Importance Assigned to Milestone
freeipmi (Debian)
New
Undecided
Unassigned
freeipmi (Ubuntu)
Undecided
Unassigned

Bug Description

Description: Ubuntu 10.04 LTS
Release: 10.04

freeipmi-bmc-watchdog:
  Installed: 0.7.15-2
  Candidate: 0.7.15-2
  Version table:
 *** 0.7.15-2 0
        500 http://ca.archive.ubuntu.com/ubuntu/ lucid/universe Packages
        100 /var/lib/dpkg/status

The init scripts provided with the package above are not LSB compliant and fail to properly startup/shutdown the daemon in various ways. During testing, in some cases the old script completely refused to start the daemon even after a cold boot. The old script was not PID aware and was not using PIDFILEs. In some cases, the daemon would be shutdown but not properly, causing eventual unexpected hard resets etc...

The logrotate configuration has an invalid path for the restart script and even then executes it with an unsupported condrestart.

Please find attached a rewritten init script based on Ubuntu 10.04 /etc/init.d/skeleton and hopefully LSB best practices.
All code paths in this init work properly for me and it has none of the cludges in the old init script.
Please also find attached a diff for the logwatch config.
Both files are in a tar because it seems attaching two files to this bug report isn't an option.

Revision history for this message
Robert Hardy (rhardy) wrote :
tags: added: patch
Revision history for this message
Carlo Marcelo Arenas Belon (carenas) wrote :

Unlike the reporter, had not that many problems with this package once the following scriplet was run on the system :

  # cd /etc/init.d && ln -s bmc-watchdog freeipmi-bmc-watchdog
  # cd /etc/default && ln -s freeipmi-bmc-watchdog bmc-watchdog
  # cd /etc/logrotate.d && perl -pi -e "s/condrestart/restart/g" freeipmi-bmc-watchdog

packages in debian unstable (0.7.17~beta2-1) and experimental (0.8.12-1) are not fully fixed either though and seems upstream (1.0.1) init script has dropped support for debian/ubuntu and so none of them are possible long term solutions

Revision history for this message
Jamie Jamison (jamie-jamison) wrote :

I had problems with the freeipmi-bmc-watchdog.

1) The configuration file in /etc/default was incorrectly named. The init script in /etc/init.d/ looks for a file named 'freeipmi-bmc-watchdog' but the installed configuration file is named 'bmc-watchdog'. This can be fixed either by symbolically linking the /etc/default/freeipmi-bmc-watchdog file to /etc/default/bmc-watchdog or by renaming the file to 'bmc-watchdog'. Since the daemon binary is '/usr/sbin/bmc-watchdog' I chose the latter.

2) The script in /etc/logrotate.d is incorrect. There is no 'condrestart' option to the bmc-watchdog script.

3) The /etc/init.d/bmc-watchdog script has other bugs. '/etc/init.d/bmc-watchdog restart' stops the daemon but does not restart it. Robert's modified script fixes this. Another way to fix this is to start bmc-watchdog via upstart. Attached is an init file I wrote for bmc-watchdog, bmc-watchdog.conf. Install the file in /etc/init, remove '/etc/init.d/bmc-watchdog' and then link '/etc/init.d/bmc-watchdog' to '/lib/init/upstart-job'. I've tested the script with start, stop, reload and restart commands and have also tested it by killing a running bmc-watchdog daemon and making sure that upstart respawns it.

Revision history for this message
Robert Hardy (rhardy) wrote :

I've rebuilt a deb suitable for inclusion in Universe which fixes this bug. If anyone copied here has an idea how to actually make that happen, please let me know.

My freeipmi_0.7.15-2ubuntu4.dsc based packages are currently in my ppa:rhardy/webconsrp here:
https://launchpad.net/~rhardy/+archive/webconsrp/+packages

You can read the change log for the details, but in summary here are the fixes:

1. Fix configuration file naming in a way which minimal carnage will ensue. i.e. Use freeipmi-bmc-watchdog everywhere.
    Depending on how people hacked things to make the old deb work. This will either pick up their existing configuration options or turn the watchdog off with the default config.

2. Adapt Jamie Jamison's upstart script and package, replacing the broken init.d based script.

3. Correct the logrotate script to use copytruncate. Watchdogs really shouldn't be interrupted for simple logrotation. This also fixes the error with the logrotate script trying to do a condrestart when the init.d script didn't support this.

4. Make sure the watchdog doesn't run by default until it is configured (this wasn't handled by Jamie's upstart script.)

5. Quilt all the patches so others can follow what I did.

Note the upstart script avoids the bmc-watchdog bugs related to quietly dying at start up by using "bmc-watchdog --clear" in two places. These are fixed in freeipmi 1.0.2 but my backporting the fixes caused more issues so my most recent 0.7.15-2ubuntu4 package uses the --clear work around instead.

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

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in freeipmi (Ubuntu):
status: New → Confirmed
Revision history for this message
Utkarsh Gupta (utkarsh) wrote :

Hello,

Thanks for opening the bug. Since this is a very old bug, I am wondering if you're still facing the same problems in the recent versions of freeipmi? In case you do, please reply to this bug or open a new open.

I am marking this as "Incomplete", but once you provide the details mentioned above, please set the status to "New" again. Thank you!

Changed in freeipmi (Ubuntu):
status: Confirmed → Incomplete
Revision history for this message
Utkarsh Gupta (utkarsh) wrote :

> packages in debian unstable (0.7.17~beta2-1) and experimental
> (0.8.12-1) are not fully fixed either though and seems upstream
> (1.0.1) init script has dropped support for debian/ubuntu and
> so none of them are possible long term solutions

Aah. I am a bit curious now. Whilst dropped in 1.0.1, I am inclined towards getting this fixed in Debian, at least, and Ubuntu can pick this up from there. Well, even if Debian doesn't want to have it included, we can have this in Ubuntu either way. And thus I ask...

> I've rebuilt a deb suitable for inclusion in Universe which fixes
> this bug. If anyone copied here has an idea how to actually make
> that happen, please let me know.

I'd be happy to work with you on that. But do you think we can start with Debian first? That is, let's get this patch submitted to Debian and then we sync it from there to here, thereby incorporating that fix. What do you think?

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

Other bug subscribers