Loose-Info.com
Last Update 2014/03/11
TOP - Unix系OS - FreeBSD - shutdown(8)

システムを終了させます。

shutdown オプション1 値1 文字列1 オプション1(任意) -h : システムを停止 -r : 再起動 ※その他オプション多数有り 値1(必須) yymmddhhmm : 時刻を指定 +m : 実行までの待ち時間を指定 now : +0同等 文字列1(任意) ユーザ全員に送られるメッセージ

※ オプションなどは個人的に重要と考えられるものを記述しており、記載の無いものは、manページや関連書籍などを参照願います。

(例) オプション -h (シェルスクリプトにて実行)
date shutdown -h now

実行結果
Thu Oct 16 22:16:13 JST 2013 Shutdown NOW! shutdown: [pid 1041] --- 以下省略 ---

ログファイル出力(/var/log/messages)
Oct 16 22:16:14 ************ shutdown: halt by ******: Oct 16 22:16:17 ************ syslogd: exiting on signal 15

(例)オプション -r(シェルスクリプトにて実行)
date shutdown -r +1

実行結果
Fri Oct 17 07:18:21 JST 2013 Shutdown at Fri Oct 17 07:19:21 2013. shutdown: [pid 1952] root@testpc:/home/testusr # *** System shutdown message from testusr@testpc *** System going down in 1 minute *** System shutdown message from testusr@testpc *** System going down in 30 seconds *** FINAL System shutdown message from testusr@testpc *** System going down IMMEDIATELY System shutdown time has arrived Connection to ***.***.***.*** closed by remote host. --- 以下省略 ---

ログファイル出力(/var/log/messages)
Oct 17 07:19:21 testpc shutdown: reboot by testusr: Oct 17 07:19:25 testpc syslogd: exiting on signal 15 Oct 17 07:20:36 testpc syslogd: kernel boot file is /boot/kernel/kernel

(例)オプション メッセージ「test」出力(シェルスクリプトにて実行)
date shutdown -r now "test"

実行結果
Fri Oct 17 07:48:23 JST 2013 Shutdown NOW! shutdown: [pid 773] *** FINAL System shutdown message from testusr@testpc *** System going down IMMEDIATELY test root@testpc:/home/testusr # System shutdown time has arrived Connection to ***.***.***.*** closed by remote host.

ログファイル出力(/var/log/messages)
Oct 17 07:48:23 testpc shutdown: reboot by testusr: test Oct 17 07:48:27 testpc syslogd: exiting on signal 15