[Nut-upsuser] POWERDOWNFLAG (/etc/killpower) does not contain the

Pino Mauro pinomauro81 at yahoo.it
Wed Sep 13 16:36:09 UTC 2006


My halt script is in /etc/init.d and contain:

#! /bin/sh
### BEGIN INIT INFO
# Provides:          halt
# Required-Start:    umountroot
# Required-Stop:
# Should-Start:      lvm raid2
# Should-Stop:
# Default-Start:     0
# Default-Stop:
# Short-Description: Execute the halt command.
# Description:
### END INIT INFO
#
# Version:      @(#)halt  2.85-22  19-Jun-2004  miquels at cistron.nl
#

PATH=/sbin:/bin:/usr/sbin:/usr/bin
. /lib/lsb/init-functions

# Get the default from /etc/default/halt.
[ -f /etc/default/halt ] && . /etc/default/halt

do_stop () {
        if [ "$INIT_HALT" = "" ]
        then
                case "$HALT" in
                        [Pp]*)
                                INIT_HALT=POWEROFF
                                ;;
                        [Hh]*)
                                INIT_HALT=HALT
                                ;;
                        *)
                                INIT_HALT=POWEROFF
                                ;;
                esac
        fi

        # See if we need to cut the power.
        if [ "$INIT_HALT" = "POWEROFF" ] && [ -x /etc/init.d/ups-monitor ]
        then
                /etc/init.d/ups-monitor poweroff
        fi

        # Don't shut down drives if we're using RAID.
        hddown="-h"
        if grep -qs '^md.*active' /proc/mdstat
        then
                hddown=""
        fi

        # If INIT_HALT=HALT don't poweroff.
        poweroff="-p"
        if [ "$INIT_HALT" = "HALT" ]
        then
                poweroff=""
        fi

        log_action_msg "Will now halt"
        halt -d -f -i $poweroff $hddown
}

case "$1" in
    start)
        ;;
    restart|reload|force-reload)
        echo "Error: argument '$1' not supported" >&2
        exit 3
        ;;
    stop)
        do_stop
        ;;
    *)
        echo "Usage: $0 start|stop" >&2
        exit 3
        ;;
esac

: exit 0

Where i can paste the code for powerdownflag? First of the "case in $1..." is ok?

 __________________________________________________
Do You Yahoo!?
Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi 
http://mail.yahoo.it 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.alioth.debian.org/pipermail/nut-upsuser/attachments/20060913/7a054ddc/attachment.htm


More information about the Nut-upsuser mailing list