Copyright © 2018 scsanjie.cn All rights reserved.
四川性福保富恒科技有限公司 版權所有
公司地址:成都市航空路6號豐德國際廣場A座12B02 電話:028-66007878
Solaris下如何關閉SUN服務器
1.成為超級用戶或承擔等效角色。
角色包含授權和具有一定權限的命令。
2.了解用戶是否已登錄到係統。
# who
屏幕上會顯示所有登錄用戶的列表。您可能需要發送郵件或廣播消息,以使用戶知道係統
即將關閉。
3.關閉係統。
# shutdown -iinit-level -g grace-period -y
-i init-level 使係統進入與缺省的S 級不同的init 級別。選項包括0、1、2、5 和6。
運行級0 和5 是為關閉係統而保留的狀態。運行級6 用於重新引導係統。
運行級2 可用作多用戶操作狀態。
-g grace-period 指示係統關閉前的時間(以秒為單位)。缺省值為60 秒。
-y 繼續關閉係統,無需任何介入。否則,係統會提示您在60 秒後繼續執行
關閉過程。
4.如果係統要求您確認,請鍵入y。
Do you want to continue? (y or n): y
如果使用了shutdown -y 命令,係統將不提示您繼續操作。
5.如果係統提示,請鍵入超級用戶口令。
Type Ctrl-d to proceed with normal startup,
(or give root password for system maintenance): xxxxxx
6.完成係統管理任務後,請按Control-D 組合鍵,以返回到缺省的係統運行級。
7.您可使用下表確認係統是否處於您在shutdown 命令中指定的運行級。
示例1:SPARC: 使服務器進入運行級S
在以下示例中,使用shutdown 命令可使基於SPARC 的係統在三分鍾內進入運行級S(單用戶級別)。
# who
root console Jun 14 15:49 (:0)
# shutdown -g180 -y
Shutdown started. Mon Jun 14 15:46:16 MDT 2004
Broadcast Message from root (pts/4) on venus Mon Jun 14 15:46:16...
The system venus will be shut down in 3 minutes .
.
.
Broadcast Message from root (pts/4) on venus Mon Jun 14 15:46:16...
The system venus will be shut down in 30 seconds .
.
.
INIT: New run level: S
The system is coming down for administration. Please wait.
Unmounting remote filesystems: /vol nfs done.
Shutting down Solaris Management Console server on port 898.
Print services stopped.
Jun 14 15:49:00 venus syslogd: going down on signal 15
Killing user processes: done.
Requesting System Maintenance Mode
SINGLE USER MODE
Root password for system maintenance (control-d to bypass): xxxxxx
single-user privilege assigned to /dev/console.
Entering System Maintenance Mode
#
示例2:SPARC: 使服務器進入運行級0
在以下示例中,使用shutdown 命令可使基於SPARC 的係統在5 分鍾內進入運行級0,而無需進行其他確認。
# who
root console Jun 17 12:39
userabc pts/4 Jun 17 12:39 (:0.0)
# shutdown -i0 -g300 -y
Shutdown started. Thu Jun 17 12:40:25 MST 2004
Broadcast Message from root (console) on pretend Thu Jun 17 12:40:25...
The system pretend will be shut down in 5 minutes
.
.
.
Changing to init state 0 -please wait
#
INIT: New run level: 0
The system is coming down. Please wait.
System services are now being stopped.
.
.
.
The system is down.
syncing file systems... done
Program terminated
Type help for more information
ok
示例3:SPARC: 將服務器重新引導至運行級3
在以下示例中,使用shutdown 命令可將基於SPARC 的係統在兩分鍾內重新引導至運行級3。不需要進行其他確認。
# who
root console Jun 14 15:49 (:0)
userabc pts/4 Jun 14 15:46 (:0.0)
# shutdown -i6 -g120 -y
Shutdown started. Mon Jun 14 15:46:16 MDT 2004
Broadcast Message from root (pts/4) on venus Mon Jun 14 15:46:16...
The system venus will be shut down in 2 minutes
Changing to init state 6 -please wait
#
INIT: New run level: 6
The system is coming down. Please wait.
.
.
.
The system is down.
syncing file systems... done
rebooting...
.
.
.
venus console login:
無論由於何種原因關閉係統,可能都需要返回到運行級3,在該級別下,所有文件資源均可用,並且用戶可以登錄。
如何關閉獨立係統
1.成為超級用戶或承擔等效角色。
角色包含授權和具有一定權限的命令。有關角色的更多信息。
2.關閉係統。
# init run-level
其中run-level 標識了新的運行級。
3.使用下表確認係統是否處於您在init 命令中指定的運行級。
示例1:使獨立係統進入運行級0
在此示例中,使用init 命令可使基於x86 的獨立係統進入可安全關閉電源的級別。
# 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
示例2:SPARC: 使獨立係統進入運行級S
在此示例中,使用init 命令可使基於SPARC 的獨立係統進入運行級S(單用戶級別)。
# init s
#
INIT: New run level: S
The system is coming down for administration. Please wait.
Unmounting remote filesystems: /vol nfs done.
Print services stopped.
syslogd: going down on signal 15
Killing user processes: done.
SINGLE USER MODE
Root password for system maintenance (control-d to bypass): xxxxxx
single-user privilege assigned to /dev/console.
Entering System Maintenance Mode
#
無論由於何種原因關閉係統,可能都需要返回到運行級3,在該級別下,所有文件資源均可用,並且用戶可以登錄。