ナビゲーションリンクをスキップ | |
印刷ビューの終了 | |
Oracle Solaris 11.1 システムのブートおよびシャットダウン Oracle Solaris 11.1 Information Library (日本語) |
次の手順と例は、shutdown および init コマンドを使用してシステムをシャットダウンする方法について説明したものです。
halt コマンドの使用など、復旧の目的でのシステムのシャットダウンについては、「SPARC: 復旧を目的としてシステムを停止する方法」を参照してください。
マルチユーザーのタイムシェアリングシステムとして使用されている Oracle Solaris システムでは、システムをシャットダウンする前に、システムにログインしているユーザーがいるかどうかの確認が必要になることがあります。このような場合は次の手順を使用します。
$ who holly console May 7 07:30 kryten pts/0 May 7 07:35 (starlite) lister pts/1 May 7 07:40 (bluemidget)
1 列目のデータはログインしているユーザーのユーザー名を示します。
2 列目のデータはログインしているユーザーの端末回線を示します。
3 列目のデータはユーザーがログインした日時を示します。
4 列目のデータ (存在する場合) は、ユーザーがリモートシステムからログインしているときのホスト名を示します。
『Oracle Solaris 11.1 の管理: セキュリティーサービス』の「割り当てられている管理権限を使用する方法」を参照してください。
# who
ログインしているすべてのユーザーがリスト表示されます。
# shutdown -iinit-state -ggrace-period -y
システムをデフォルトの S とは異なる init 状態にします。0、1、2、5、6 のいずれかを指定できます。
実行レベル 0 および 5 は、システムのシャットダウン用に予約された状態です。実行レベル 6 はシステムをリブートします。実行レベル 2 はマルチユーザーオペレーティング状態として使用できます。
システムがシャットダウンするまでの時間 (秒) を示します。デフォルト値は 60 秒です。
ユーザーの介入なしにシャットダウンを継続します。それ以外の場合、シャットダウンを継続するかどうか 60 秒後に尋ねられます。
詳細は、shutdown(1M) のマニュアルページを参照してください。
Do you want to continue? (y or n): y
-y オプションを指定した場合、このプロンプトは表示されません。
Type Ctrl-d to proceed with normal startup, (or give root password for system maintenance): xxxxxx
|
例 3-1 shutdown コマンドを使用してシステムをシングルユーザー状態 (実行レベル S) にする
次の例では、shutdown コマンドを使用して、3 分後にシステムを実行レベル S (シングルユーザー状態) にしています。
# who root console Apr 15 06:20 # shutdown -g180 -y Shutdown started. Fri Apr 15 06:20:45 MDT 2011 Broadcast Message from root (console) on portia Fri Apr 15 06:20:46... The system portia will be shut down in 3 minutes showmount: portia: RPC: Program not registered Broadcast Message from root (console) on portia Fri Apr 15 06:21:46... The system portia will be shut down in 2 minutes showmount: portia: RPC: Program not registered Broadcast Message from root (console) on portia Fri Apr 15 06:22:46... The system portia will be shut down in 1 minute showmount: portia: RPC: Program not registered Broadcast Message from root (console) on portia Fri Apr 15 06:23:16... The system portia will be shut down in 30 seconds showmount: portia: RPC: Program not registered Changing to init state s - please wait svc.startd: The system is coming down for administration. Please wait. root@portia:~# Apr 15 06:24:28 portia svc.startd[9]: Apr 15 06:24:28 portia syslogd: going down on signal 15 svc.startd: Killing user processes. Requesting System Maintenance Mode (See /lib/svc/share/README for more information.) SINGLE USER MODE Enter user name for system maintenance (control-d to bypass):xxxxxx #
例 3-2 shutdown コマンドを使用してシステムをシャットダウン状態 (実行レベル 0) にする
次の例では、shutdown コマンドを使用して、追加の確認を求めずに 5 分後にシステムを実行レベル 0 にしています。
# who root console Jun 17 12:39... userabc pts/4 Jun 17 12:39 (:0.0) # shutdown -i0 -g300 -y Shutdown started. Fri Apr 15 06:35:48 MDT 2011 Broadcast Message from root (console) on murky Fri Apr 15 06:35:48... The system pinkytusk will be shut down in 5 minutes showmount: murkey: RPC: Program not registered showmount: murkey: RPC: Program not registered Broadcast Message from root (console) on murkey Fri Apr 15 06:38:48... The system murkey will be shut down in 2 minutes showmount: murkey: RPC: Program not registered Broadcast Message from root (console) on murkey Fri Apr 15 06:39:48... The system murkey will be shut down in 1 minute showmount: murkey: RPC: Program not registered Broadcast Message from root (console) on murkey Fri Apr 15 06:40:18... The system murkey will be shut down in 30 seconds showmount: murkey: RPC: Program not registered Broadcast Message from root (console) on murkey Fri Apr 15 06:40:38... THE SYSTEM murkey IS BEING SHUT DOWN NOW ! ! ! Log off now or risk your files being damaged showmount: murkey: RPC: Program not registered Changing to init state 0 - please wait root@murkey:~# svc.startd: The system is coming down. Please wait. svc.startd: 122 system services are now being stopped. Apr 15 06:41:49 murkey svc.startd[9]: Apr 15 06:41:50 murkey syslogd: going down on signal 15 svc.startd: Killing user processes. Apr 15 06:41:57 The system is down. Shutdown took 69 seconds. syncing file systems... done Press any key to reboot. Resetting...
すべてのデバイスの電源を切断するためにシステムを実行レベル 0 にする場合は、「システムデバイスの電源の切断」を参照してください。
例 3-3 shutdown コマンドを使用してシステムをマルチユーザー状態 (実行レベル 3) にする
次の例では、shutdown コマンドを使用して、2 分後にシステムを実行レベル 3 にリブートしています。確認用プロンプトが表示されないように y オプションを指定しています。
# who root console Jun 14 15:49 (:0) userabc pts/4 Jun 14 15:46 (:0.0) # shutdown -i6 -g120 -y Shutdown started. Fri Apr 15 06:46:50 MDT 2011 Broadcast Message from root (console) on venus Fri Apr 15 06:46:50... The system venus will be shut down in 2 minutes showmount: venus: RPC: Program not registered showmount: venus: RPC: Program not registered Broadcast Message from root (console) on venus Fri Apr 15 06:47:50... The system venus will be shut down in 1 minute showmount: venus: RPC: Program not registered showmount: venus: RPC: Program not registered Broadcast Message from root (console) on venus Fri Apr 15 06:48:20... The system venus will be shut down in 30 seconds showmount: venus: RPC: Program not registered Broadcast Message from root (console) on venus Fri Apr 15 06:48:40... THE SYSTEM venus IS BEING SHUT DOWN NOW ! ! ! Log off now or risk your files being damaged showmount: venus: RPC: Program not registered Changing to init state 6 - please wait root@venus:~# svc.startd: The system is coming down. Please wait. svc.startd: 123 system services are now being stopped. Apr 15 06:49:32 venus svc.startd[9]: Apr 15 06:49:32 venus syslogd: going down on signal 15 svc.startd: Killing user processes. Apr 15 06:49:40 The system is down. Shutdown took 50 seconds. syncing file systems... done rebooting... SunOS Release 5.11 Version 2010-12-10 64-bit Copyright (c) 1983, 2010, Oracle and/or its affiliates. All rights reserved. Booting to milestone "milestone/single-user:default". Hostname: venus NIS domain name is solaris.example.com . . . venus console login:
参照
システムをシャットダウンした理由にかかわらず、すべてのファイルリソースが利用可能かつユーザーがログイン可能な、実行レベル 3 にシステムが戻ることを想定しているでしょう。システムをマルチユーザー状態に戻す手順については、第 4 章システムのブート (タスク) を参照してください。
スタンドアロンシステムをシャットダウンする必要がある場合は、次の手順を実行します。
『Oracle Solaris 11.1 の管理: セキュリティーサービス』の「割り当てられている管理権限を使用する方法」を参照してください。
# init 5
詳細は、init(1M) のマニュアルページを参照してください。
例 3-4 init コマンドを使用してシステムをシャットダウン状態 (実行レベル 0) にする
この例では、init コマンドを使用して、スタンドアロンシステムを安全な電源切断が可能な実行レベルにしています。
# init 0 # INIT: New run level: 0 The system is coming down. Please wait. . . . The system is down. syncing file systems... [11] [10] [3] done Press any key to reboot
参照
システムをシャットダウンした理由にかかわらず、すべてのファイルリソースが利用可能かつユーザーがログイン可能な、実行レベル 3 にシステムが戻ることを想定しているでしょう。