--- halt.old 2009-10-01 05:03:02 +0500 +++ halt 2009-10-07 12:54:35 +0500 @@ -19,6 +19,9 @@ unset action +[ -f /etc/sysconfig/halt ] && . /etc/sysconfig/halt +[ -n "$HALTCMD" ] || HALTCMD=/sbin/poweroff + action_begin_msg() { [ -z "$*" ] || printf '%s ' "$*" @@ -83,8 +86,12 @@ # See how we were called. case "$0" in - *halt|*poweroff) + *halt) message='The system is halted' + command=$HALTCMD + ;; + *poweroff) + message='The system is halted; trying to turn off the power' command=/sbin/poweroff ;; *reboot) @@ -175,14 +182,14 @@ if [ -x "$UPSCTL" -a -f /etc/apcupsd/powerfail ]; then action 'Attempting to turn the UPS off:' "$UPSCTL" killpower message='The system is halted' - command=/sbin/poweroff + command=$HALTCMD fi UPSCTL=/sbin/upsdrvctl if [ -x "$UPSCTL" -a -f /etc/killpower ]; then action 'Attempting to turn the UPS off:' "$UPSCTL" shutdown message='The system is halted' - command=/sbin/poweroff + command=$HALTCMD fi if [ "$command" = /sbin/poweroff ]; then