关机关的有点恐怖[已解决]
- adqin
- 帖子: 1417
- 注册时间: 2007-01-24 22:07
- 来自: http://adqin.cn
- 联系:
-
- 帖子: 176
- 注册时间: 2005-09-23 20:37
#! /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
PATH=/usr/sbin:/usr/bin:/sbin:/bin
[ -f /etc/default/halt ] && . /etc/default/halt
. /lib/lsb/init-functions
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"
sleep 1
halt -d -f -i $poweroff $hddown
}
case "$1" in
start)
# No-op
;;
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
:
是改那一个
### 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
PATH=/usr/sbin:/usr/bin:/sbin:/bin
[ -f /etc/default/halt ] && . /etc/default/halt
. /lib/lsb/init-functions
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"
sleep 1
halt -d -f -i $poweroff $hddown
}
case "$1" in
start)
# No-op
;;
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
:
是改那一个
- qq52073344
- 帖子: 169
- 注册时间: 2006-12-07 6:38
- 联系:
-
- 帖子: 3
- 注册时间: 2007-05-14 17:54
http://maweiqiang.blogspot.com/2007/05/ ... oblem.html
我是这么解觉的,参考了ubuntu的launchpad
我是这么解觉的,参考了ubuntu的launchpad
-
- 帖子: 14
- 注册时间: 2007-05-19 11:57
这种方法与前面一种有什么区别?weiqiang 写了:http://maweiqiang.blogspot.com/2007/05/ ... oblem.html
我是这么解觉的,参考了ubuntu的launchpad
另外,我修改sleep数值到30,还是听见”咔“的一声,跟以前没有任何区别...
我的ubuntu是装在移动硬盘上
-
- 帖子: 49
- 注册时间: 2007-05-26 23:57
- 联系: