• No results found

System Shutdown

In document Rehman_HP (Page 178-183)

Chapter review questions

BOOTING IN SINGLE-USER MODE

Reserved for shutdown When the system goes to this runlevel, it stops all processes and brings the system to a halted state.

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

Chapter Summary

HP-UX startup and shutdown processes are explained in this chapter. We started with an introduction to the startup process and listed the steps involved. The startup process can be divided into two major parts. The first part consists of steps that are performed by code that resides in ROM. This code is called processor dependent code (PDC) and is different for each model of server and workstation. The second part consists of processes that are performed by the operating system. This part starts with the Initial System Loader (ISL). The ISL loads the hpux utility, which in turn loads the HP-UX kernel, /stand/vmunix, into the memory. The kernel starts the swapper process, ioinitrc, and then the init process. The init process starts the server daemons and brings the system into the appropriate runlevel state. At shutdown time, the init process changes the runlevel to 0 and halts the system.

In brief, the following items are discussed in the chapter.

• Processor dependent code (PDC) does a self-test and probes the hardware attached can be used to boot HP-UX in single-user mode.

• PDC uses the Stable Storage Area to keep configuration information. • The to the system.

• PDC menus can be used to search devices attached to the system and to specify primary and secondary boot devices.

• PDC can be used to boot from a particular device.

• PDC boot area of the disk is in LIF format and it contains the ISL and some utility programs. • The swapper process has process ID 0 and manages memory swapping.

• The init process reads the /etc/inittab file for its configuration.

• Runlevel is a state of the system that shows what services are available at a particular time. HP- UX is in one of eight runlevels at all times.

• To add a program to be run at boot time, you place an execution script in the /sbin/init.d directory and its configuration file in the /etc/rc.config.d directory. You place links to the script in the sequencer directories. The sequencer directories have names like /sbin/rcn.d where n represents a runlevel. • The shutdown command gets help from the execution scripts called by their respective links in the sequencer directories to stop server daemons and halt the system. The reboot command kills these daemons and reboots the system. The /etc/shutdown.allow files show which users are allowed to execute the shutdown command.

Chapter Review Questions

1: Why is understanding the startup and shutdown processes important for system administration?

2: Where does PDC store its configuration information? What potential problem may arise if this information is stored on the disk?

3: List the steps performed by PDC during the startup process.

4: What are runlevels and what is their utility?

5: List three tasks performed by the init process.

6: What are sequencer directories?

Test Your Knowledge

1: All HP-9000 systems have processor dependent code (PDC). What is true about it?

It is used to add processors that are dependent on each other. PDC on all HP systems is the same.

It is a programming language for HP processors. It is used to initialize and boot HP systems. 2: The autoboot information is stored in:

the AUTO file in the LIF area the ISL

PDC

stable storage

3: What can be used to boot HP-UX in single-user mode?

PDC

the hpux utility when properly called from the ISL both of the above

none of the above

4: What is the function of the secondary loader?

It loads the HP-UX kernel if the primary loader fails. It is a utility that loads the HP-UX kernel during boot time. It loads the ISL in the second phase of the boot process. It is a configuration file for the kernel.

5: The boot area of the primary system disk contains:

LIF

the hpux utility the AUTO file all of the above

6: The search command in PDC is used to:

search primary boot disks search all boot devices search all network interfaces search lost console devices

7: What is the order of execution of scripts becheckrc, ioinitrc, and rc?

bcheckrc, ioinitrc, rc ioinitrc, bcheckrc, rc rc, ioinitrc, bcheckrc rc, becheckrc, ioinitrc

8: What information is present in stable storage?

primary boot path alternate boot path

all of the above

9: What is true about the lifls command?

It is a standard HP-UX command to list files in the LIF area. It is an LIF command to list files in the LIF area.

It is a PDC command to list files in the LIF area.

It is an LIF command used to list files in an HP-UX partition. 10

: The ID field in the processor ID number /etc/inittab file shows:

the process ID number for the program in the action area an arbitrary string to represent an entry in the file

runlevel in which the process is started 11

: What happens if the runlevel for a program is not specified in the The program is never started. /etc/inittab file? The program is started in all runlevels.

The program is started at the boot time. The program is started only in runlevel 0. 12

: Which runlevel can be used for multiuser operation?0 1

s 3 13

: What command is used to check the current runlevel?runlevel who -r

showrun init

Chapter Syllabus

15.1 Software Packaging Structure

In document Rehman_HP (Page 178-183)