On certain HW (e.g. IBM HS20 blade) the /dev/watchdog is created by kernel
during boot (provided by i6300esb driver). /etc/init.d/ipmi script then does
not recognize the device is already there and tries to configure new one,
which obviously fails. The init script does not show any error and pretends
everything is OK:

Starting ipmi drivers: [  OK  ]
Starting ipmi_watchdog driver: [  OK  ]
$ echo $?
0

IPMI watchdog is not started, as I requested in /etc/sysconfig/ipmi:
$ grep WATCHDOG /etc/sysconfig/ipmi
IPMI_WATCHDOG=yes
IPMI_WATCHDOG_OPTIONS="timeout=60000 action=power_cycle start_now=1"

$ ipmitool mc watchdog get
Watchdog Timer Use:     SMS/OS (0x04)
Watchdog Timer Is:      Stopped
Watchdog Timer Actions: No action (0x00)
Pre-timeout interval:   0 seconds
Timer Expiration Flags: 0x10
Initial Countdown:      160 sec
Present Countdown:      160 sec


The i6300esb driver uses the same major/minor device numbers as the OpenIPMI
one, so it's not possible to initialize correct /dev/watchdog device.

Following patch is my proposal how to show user that something is wrong.
It's accomplished using very simple check for /dev/watchdog, feel free to
suggest something better.

$ service ipmi start
Starting ipmi drivers: [  OK  ]
Starting ipmi_watchdog driver: /dev/watchdog already exists[FAILED]
$ echo $?
8

Signed-off-by: Jan Safranek <[email protected]>
---

 ipmi.init |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/ipmi.init b/ipmi.init
index c08511b..bb14de4 100644
--- a/ipmi.init
+++ b/ipmi.init
@@ -205,6 +205,11 @@ load_hw_modules()
 
 start_watchdog_common()
 {
+       if [ -e /dev/watchdog ]; then
+               log_failure_msg "/dev/watchdog already exists "
+               RETVAL=$((RETVAL | 8))
+               return
+       fi
        load_hw_modules
        modprobe ipmi_watchdog ${IPMI_WATCHDOG_OPTIONS} > /dev/null 2>&1
        modules_loaded ipmi_watchdog


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Openipmi-developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openipmi-developer

Reply via email to