[Nut-upsuser] POWERDOWNFLAG (/etc/killpower) does not contain the
Peter Selinger
selinger at mathstat.dal.ca
Thu Sep 14 02:09:32 UTC 2006
Try pasting it just before: "# See if we need to cut the power"
You should test this of course, by unplugging the UPS and waiting
until the battery runs out. Your computer should shut down gracefully
(but you should be prepared in case it does not).
-- Peter
Pino Mauro wrote:
>
> --===============1420676555==
> Content-Type: multipart/alternative; boundary="0-1777563259-1158165369=:64633"
>
> --0-1777563259-1158165369=:64633
> Content-Type: text/plain; charset=iso-8859-1
>
> 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
> --0-1777563259-1158165369=:64633
> Content-Type: text/html; charset=iso-8859-1
>
> My halt script is in /etc/init.d and contain:<br><br>#! /bin/sh<br>### BEGIN INIT INFO<br># Provides: halt<br># Required-Start: umountroot<br># Required-Stop:<br># Should-Start: lvm raid2<br># Should-Stop:<br># Default-Start: 0<br># Default-Stop:<br># Short-Description: Execute the halt command.<br># Description:<br>### END INIT INFO<br>#<br># Version: @(#)halt 2.85-22 19-Jun-2004 miquels at cistron.nl<br>#<br><br>PATH=/sbin:/bin:/usr/sbin:/usr/bin<br>. /lib/lsb/init-functions<br><br># Get the default from /etc/default/halt.<br>[ -f /etc/default/halt ] && . /etc/default/halt<br><br>do_stop () {<br> if [ "$INIT_HALT" = "" ]<br>
> then<br> case "$HALT" in<br> [Pp]*)<br> INIT_HALT=POWEROFF<br> ;;<br>
> [Hh]*)<br> INIT_HALT=HALT<br> ;;<br> *)<br> INIT_HALT=POWEROFF<br>
> ;;<br> esac<br> fi<br><br> # See if we need to cut the power.<br> if [ "$INIT_HALT" = "POWEROFF" ] && [ -x /etc/init.d/ups-monitor ]<br> then<br> /etc/init.d/ups-monitor poweroff<br> fi<br><br> # Don't shut down drives if we're using RAID.<br> hddown="-h"<br> if grep -qs '^md.*active' /proc/mdstat<br> then<br>
> hddown=""<br> fi<br><br> # If INIT_HALT=HALT don't poweroff.<br> poweroff="-p"<br> if [ "$INIT_HALT" = "HALT" ]<br> then<br> poweroff=""<br> fi<br><br> log_action_msg "Will now halt"<br> halt -d -f -i $poweroff $hddown<br>}<br><br>case "$1" in<br> start)<br> ;;<br> restart|reload|force-reload)<br> echo "Error: argument '$1' not supported" >&2<br> exit
> 3<br> ;;<br> stop)<br> do_stop<br> ;;<br> *)<br> echo "Usage: $0 start|stop" >&2<br> exit 3<br> ;;<br>esac<br><br>: exit 0<br><br>Where i can paste the code for powerdownflag? First of the "case in $1..." is ok?<br><p> __________________________________________________<br>Do You Yahoo!?<br>Poco spazio e tanto spam? Yahoo! Mail ti protegge dallo spam e ti da tanto spazio gratuito per i tuoi file e i messaggi <br>http://mail.yahoo.it
> --0-1777563259-1158165369=:64633--
>
>
> --===============1420676555==
> Content-Type: text/plain; charset="us-ascii"
> MIME-Version: 1.0
> Content-Transfer-Encoding: 7bit
> Content-Disposition: inline
>
> _______________________________________________
> Nut-upsuser mailing list
> Nut-upsuser at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser
>
> --===============1420676555==--
>
More information about the Nut-upsuser
mailing list