Managing Systems and Workgroups: A Guide for HP-UX System Administrators
Administering a System: Booting and Shutdown
Shutting Down Systems
Chapter 5 523
• the wall command (see wall (1M)) — only notifies users of your
system, not users of other systems that are likely to be affected by a
shutdown of your system
• calling them on the phone, or speaking to them in person
However you do it, the critical thing is to notify them as far in advance as
possible of your planned shutdown. If you notify them far in advance of
the planned shutdown, it is also a good idea to give them a reminder as
the time for the shutdown approaches.
Step 2. Once everyone has been notified and had a chance to prepare for the
shutdown, execute the shutdown command to initiate an ordered
shutdown of your system.
There are basically three types of system shutdown:
1. Shutdown with immediate reboot (use shutdown’s -r option)
2. Shutdown with system halt (use shutdown’s -h option)
3. Put system in single-user mode for system maintenance (use neither
the -r nor the -h option)
Common Variations of the shutdown Command
Here are some examples of shutdown commands to show you each type of
system shutdown. shutdown is by default an interactive program. Other
than telling shutdown whether or not you want to halt or reboot the
system, information omitted from the command line will be prompted for.
If you do not tell shutdown that you want to halt or reboot the computer,
it will assume that you want to bring the system to single-user mode.
Example 5-29 Shutdown and Reboot
To immediately shut down the system and reboot it:
/sbin/shutdown -r 0
Example 5-30 Shutdown and Reboot with Wait
To shut down the system and immediately reboot it after first giving the
users of the system three minutes (180 seconds) to clean up their
work-in-progress and log out:
/sbin/shutdown -r 180