Date: Fri, 9 Sep 2011 17:22:41 GMT From: Michael Scheidell <scheidell@secnap.net> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/160592: sysutils/freeipmi Add bmc-watchdog.rc Message-ID: <201109091722.p89HMf0R010821@red.freebsd.org> Resent-Message-ID: <201109091730.p89HU9KI094029@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 160592 >Category: ports >Synopsis: sysutils/freeipmi Add bmc-watchdog.rc >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Fri Sep 09 17:30:08 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Michael Scheidell >Release: 7,3, 7,4, etc >Organization: SECNAP Network Security >Environment: lots of them >Description: freeipmi comes with a bmc-watchdog (if you have ipmi/bmc on board) this uses a hardware watchdog timer, rather then (just) the kernel 'watchdog' daemon. (if the system is locked up, the kernel might not be able to trigger a reboot anyway) All this patch does is add a ../rc.d/bmc-watchdog rc script. options taken from Linux freeipmi-bmc-watchdog /etc/init.d/ script. been using this for several months. note, there WAS a strange bug in 1.0.5 that made SOME dell systems reset. this is not the case with 1.0.6. also note: it would be MUCH BETTER if the kernel watchdog could soft boot/sync fsys, but failing that, maybe a hard reset is in order for critical systems. >How-To-Repeat: na >Fix: apply patch. (adds rc script) not sure if this needs a portsbump, since if someone is already using freeipmi, then don't need to install this. Patch attached with submission follows: diff -bBru /var/tmp/freeipmi/files/bmc-watchdog.in ./files/bmc-watchdog.in --- /var/tmp/freeipmi/files/bmc-watchdog.in 2011-09-09 13:07:02.000000000 -0400 +++ ./files/bmc-watchdog.in 2011-09-09 13:06:14.000000000 -0400 @@ -0,0 +1,46 @@ +#!/bin/sh +# + +# PROVIDE: bmc_watchdog +# REQUIRE: devfs +# KEYWORD: nojail shutdown +# +# Add the following line to /etc/rc.conf to enable bmc-watchdog: +# +# bmc_watchdog_enable="YES" +# +bmc_watchdog_enable=${bmc_watchdog_enable:-"NO"} +# This will prevent reboot loops. +bmc_watchdog_failsafe=${bmc_watchdog_failsafe:-"YES"} +# +# see bmc-watchdog(8) for flags +. /etc/rc.subr + +name=bmc_watchdog +rcvar=`set_rcvar` + +command=%%PREFIX%%/sbin/bmc-watchdog +bmc_watchdog_log=${bmc_watchdog_log:-"/var/log/freeipmi/bmc-watchdog.log"} +bmc_watchdog_flags=${bmc_watchdog_flags:-"-d -u 4 -p 0 -a 1 -F -P -L -S -O -i 900 -e 60}" +bmc_watchdog_flags="${bmc_watchdog_flags} -f ${bmc_watchdog_log}" + +start_precmd=start_precmd +stop_precmd=stop_precmd + +start_precmd() { + ${command} -y + if checkyesno bmc_watchdog_failsafe ;then + if tail -1 ${bmc_watchdog_log} 2>/dev/null | grep ": starting bmc-watchdog daemon$" >/dev/null 2>&1; then + date -j +"[%b %e %X]: failsafe bmc-watchdog daemon" >> ${bmc_watchdog_log} + err 1 "Fail Safe: System Crash. Not starting bmc-watchdog" + fi + fi +return 0 +} + +stop_precmd() { + ${command} -y +} + +load_rc_config $name +run_rc_command "$1" >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201109091722.p89HMf0R010821>