LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
123
返回列表 发新帖
楼主: gwdwx

为保证硬盘指针正常归位,如何控制在关闭操作系统,10秒后再关闭电源?(已经解决!见内)

[复制链接]
发表于 2007-2-12 10:56:13 | 显示全部楼层
原来硬盘声音还有这种说法, 学到不少东西 。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-2-12 13:31:48 | 显示全部楼层
Post by topfzy
我的Ubuntu也有这声音啊!  suse可以通过加  sleep 10来解决那ubuntu呢?


ubuntu没有/etc/init.d/halt文件吗?应该都一样的处理方式吧。。。
回复 支持 反对

使用道具 举报

发表于 2007-2-12 15:24:54 | 显示全部楼层

贴贴ubuntu里halt里的内容吧,怎么加好呢?

#! /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" = "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"
        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

:
回复 支持 反对

使用道具 举报

发表于 2007-2-15 16:38:05 | 显示全部楼层
Post by d00m3d
今时今日的硬盘都能自动 park 的吧

不知道笔记本是否和台式有不用,没注意过这个问题。

最后那个  exec $command -d -f 中的 $command 是什么命令来的?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2007-2-17 00:05:42 | 显示全部楼层
Post by 晨想
不知道笔记本是否和台式有不用,没注意过这个问题。

最后那个  exec $command -d -f 中的 $command 是什么命令来的?


应该就是 halt 指令了。
回复 支持 反对

使用道具 举报

发表于 2007-2-17 12:41:27 | 显示全部楼层
我原来的旧机器用ide硬盘就是这样,后来新电脑+sata硬盘就没有了(台式机)
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表