友人宅に置いてある CentOS 5 の自鯖(この blog が動いている鯖ではない)の電源を切らなければいけなくなったのですが、電源ボタンを短押しした時の挙動を調べていて shutdown コマンドの man ページを見ると、

        -h     Halt or poweroff after shutdown.

と書いてあることに気が付きました(太字は梅澤による)。えっ。

実機をシャットダウンするのはまだ早いので、VMware 上の CentOS 5 で shutdown -h now したところ、確かにシャットダウン後に電源が切れます。Linux 上で shutdown コマンドなんて10年以上使っていないから知りませんでしたよ(代わりに reboot や poweroff コマンドを使う)。

CentOS 5 (SysVinit ベース)以外はどうなのかと思って他のディストリビューションの man ページを見ましたが、Upstart ベースの CentOS 6 では、

       -h     Requests  that  the system be either halted or powered off after
              it has been brought down, with the choice as to which left up to
              the system.

となっていますし、systemd ベースの Ubuntu 15.4 は、

        -h
            Equivalent to --poweroff, unless --halt is specified.

となっています。

ちなみに *BSD だと shutdown -h コマンドは昔からずっとホールトして終わり(APM/ACPI 環境であっても電源は切れない)のはずですし、man を見ても電源が切れるとは書かれていません。

Trackback

2 comments untill now

  1. 今どきというか、1999年ころに自分が初めてLinuxに触れた時からshutdown -hは電源が切れていたような…

  2. 梅澤 威志 @ 2015-08-19 08:00

    マジカヨ

Add your comment now