14.9 System Shutdown

   

System shutdown is needed when you want to carry out maintenance work, such as adding or replacing some devices or upgrading memory. You also need to shut down and restart your system when you build a new kernel. The shutdown command is used for this purpose. Important options with the shutdown command are:

-r Reboot the system after shutdown
-h Halt the system after shutdown
-y Does not require any interactive response

You can supply time in seconds as an argument to the command to delay the shutdown process for a specified number of seconds. You must change to the / directory before using this command. A broadcast message is sent to all logged-in users notifying them that the system is going down.

To shut down and halt your system after two minutes, use the following command.

 # shutdown -h -y 0 

You will see shutdown messages like the following, appear on your screen.

 SHUTDOWN PROGRAM 07/17/99 13:28:50 EDT Broadcast Message from root (console) Sat Jul 17 13:28:51... SYSTEM BEING BROUGHT DOWN NOW ! ! ! /sbin/auto_parms: DHCP access is disabled (see /etc/auto_parms.log)      System shutdown in progress      ___________________________      Stop CDE login server ..................................... OK      Stop X print server(s) .................................... N/A      Stop NFS server subsystem ................................. OK      Stopping Event Monitoring Service ......................... OK      Stopping Netscape FastTrack Server ........................ OK      Shutting down Measureware performance software ............ OK      Stopping audio server daemon .............................. OK      Stop auditing subsystem ................................... N/A      Stop environment monitoring daemon ........................ OK      Stopping hardware predictive .............................. OK      Stop diagnostic subsystem ................................. OK      Stop clock daemon ......................................... OK      Stopping HP Distributed Print Service ..................... OK      Stop print spooler ........................................ OK      Stopping disk array monitor daemons. ...................... OK      Stop accounting ........................................... OK      Stopping time synchronization ............................. FAIL *      Stop vt daemon ............................................ OK      Terminating X Font Server ................................. OK      Stop remote boot daemon ................................... OK      Stop the Isogon License Server daemon ..................... OK      Stop RPC daemon ........................................... OK      Stop DCE daemons .......................................... OK      Stop HA cluster SNMP subagent ............................. OK      Stopping OSPF MIB Network Management subAgent ............. N/A      Stopping SNMP HP-UNIX Network Management subAgent ......... OK      Stopping SNMP MIB-2 Network Management subAgent ........... OK      Stopping SNMP Trap Dest Network Management subAgent ....... OK      Stopping SNMP Master Network Management daemon ............ OK      Stopping outbound connection daemons for DDFA software .... N/A      Stopping mail daemon ...................................... OK      Stopping remote system status daemon ...................... N/A      Stopping RARP protocol daemon ............................. N/A      Stop PPP configuration .................................... OK      Stopping router discover protocol daemon .................. N/A      Stopping dynamic routing daemon ........................... N/A      Stopping Internet services daemon ......................... OK      Stopping multicast routing daemon ......................... N/A      Stop the Trusted Mode with Nis+ subsystem ................. OK      Stopping Internet Services ................................ OK      Stop NFS client subsystem ................................. OK      Stop NIS client subsystem ................................. OK      Stop NIS server subsystem ................................. OK      Stop NIS+ client subsystem ................................ OK      Stop NIS+ server subsystem ................................ OK      Stop NFS core subsystem ................................... OK      Stopping name server daemon ............................... N/A      Unconfigure LAN interfaces ................................ OK      Stop network tracing and logging daemon ................... OK      Stop pty allocator daemon ................................. OK      Stop system message logging daemon ........................ OK      Stop Software Distributor agent daemon .................... OK      Unconfigure Loopback interfaces (lo0) ..................... OK      Stop syncer daemon ........................................ OK      Killing user processes .................................... OK      Unload loadable modules ................................... N/A      Update kernel and loadable modules ........................ N/A      Unmount file systems ...................................... OK Transition to run-level 0 is complete. Executing "/sbin/reboot -h       ". Shutdown at 13:30 (in 0 minutes)         *** FINAL System shutdown message from root@myhp *** System going down IMMEDIATELY System shutdown time has arrived reboot:  CAUTION: some process(es) wouldn't die Timeout waiting for other processors to acknowledge reboot. sync'ing disks (0 buffers to flush): 0 buffers not flushed 0 buffers still dirty 

The shutdown command invokes /sbin/rc scripts which in turn use sequencer scripts to shut down all daemons before halting the system. The /etc/shutdown.log file keeps a log of shutdown or reboot of the system. Some log entries in this file are shown here.

 15:24  Thu Sep 18, 1997.  Reboot: 06:58  Fri Sep 19, 1997.  Reboot: 08:10  Fri Sep 19, 1997.  Halt:  (by myhp!root) 12:16  Fri Sep 19, 1997.  Reboot:  (by myhp!root) 13:17  Fri Sep 19, 1997.  Reboot after panic: Data page fault 07:43  Mon Sep 22, 1997.  Reboot:  (by myhp!root) 08:20  Mon Sep 22, 1997.  Reboot:  (by myhp!root) 08:41  Mon Sep 22, 1997.  Reboot: 09:04  Mon Sep 22, 1997.  Reboot:  (by myhp!root) 10:18  Mon Sep 22, 1997.  Reboot:  (by myhp!root) 

Shutdown and Reboot Commands

The reboot command kills all processes instead of gracefully terminating them. Therefore, this speeds up the shutdown process but may cause data loss if other users are working on the system at the time of the reboot. If you are working in single-user mode, then it is safe to use the reboot command. Otherwise, always use the shutdown command.

The shutdown.allow File

This file is used to allow some system users to execute the shutdown command. Each line contains a system name followed by user names . Any user listed in this file has the privilege to shut down the system. An asterisk in the system name allows a user of given name from any system to execute the shutdown command. Some sample entries in this file are:

 myhp root myhp operator * boota 

   
Top


HP Certified
HP Certified: HP-UX System Administration
ISBN: 0130183741
EAN: 2147483647
Year: 2000
Pages: 390
Authors: Rafeeq Rehman

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net