From owner-freebsd-ports-bugs@FreeBSD.ORG Fri Sep 9 17:30:09 2011 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D2591065677 for ; Fri, 9 Sep 2011 17:30:09 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 4938F8FC15 for ; Fri, 9 Sep 2011 17:30:09 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p89HU9Sp094032 for ; Fri, 9 Sep 2011 17:30:09 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p89HU9KI094029; Fri, 9 Sep 2011 17:30:09 GMT (envelope-from gnats) Resent-Date: Fri, 9 Sep 2011 17:30:09 GMT Resent-Message-Id: <201109091730.p89HU9KI094029@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Michael Scheidell Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C22F0106564A for ; Fri, 9 Sep 2011 17:22:41 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 981338FC08 for ; Fri, 9 Sep 2011 17:22:41 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p89HMfth010834 for ; Fri, 9 Sep 2011 17:22:41 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id p89HMf0R010821; Fri, 9 Sep 2011 17:22:41 GMT (envelope-from nobody) Message-Id: <201109091722.p89HMf0R010821@red.freebsd.org> Date: Fri, 9 Sep 2011 17:22:41 GMT From: Michael Scheidell To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: ports/160592: sysutils/freeipmi Add bmc-watchdog.rc X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Sep 2011 17:30:09 -0000 >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: