Managing Systems and Workgroups: A Guide for HP-UX System Administrators
Administering a System: Booting and Shutdown
Shutting Down Systems
Chapter 5 525
• Verifies that the user attempting to shut down the system has
permission to do so (checks the /etc/shutdown.allow file).
• Changes the current working directory to the root directory (/).
• Runs the sync command to be sure that file system changes still in
memory are updated in the superblocks and file system structures on
disk. This is one of shutdown’s most important functions!
• Sets the real user ID to that of the superuser (see setuid (2) for
information on user IDs).
• Sends a broadcast message to all users currently logged in to the
system telling them that the system is about to be shut down. There
is a default broadcast message, but you can specify your own if you
prefer.
• /sbin/rc is executed to shut down subsystems, unmount file
systems, and perform other tasks to bring the system to run level 0,
where it is safe to power off your system if you do not plan to
immediately reboot it.
✓ If your system is an NFS cluster server, before /sbin/rc is
executed, the optional -o argument is used to determine whether
or not to also reboot the NFS cluster clients served by your
system. By default (when -o is not specified), all clients served by
this server will be rebooted too. When -o is specified, only the
server will be rebooted. Once the decision about whether or not to
reboot the clients has been made, /sbin/rc is executed.
✓ If your system is an NFS cluster client, /sbin/rc brings the
system down to run level 2 (single-user state is not permitted on
an NFS cluster client).
• Finally, if your system is not an NFS cluster client, and you are not
shutting your system down to single-user mode (see “Single-User
Mode” on page 527), the program /sbin/reboot is executed to halt
your system or reboot it if the -h or -r option (respectively) was
specified.
Power Failure
Not every shutdown can be planned for. An unexpected power failure is
an example of an unplanned shutdown.