|
|
发表于 2007-5-21 22:47:55
|
显示全部楼层
高手看看hiweed的shutdown脚本吧,hiweed关机很正常,而archlinux关机的确让人挺害怕的,对照着改改脚本应该就可以解决问题的吧!
#! /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@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" = " OWEROFF" ] && [ -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 |
|