• Aucun résultat trouvé

Shutting Down the System

You should never just turn an HP- UX system off! Instead, shut the system down properly. In an HP-UX cluster, you can turn a cnode for a client off, but do not turn the cluster server off. Typically, you shut down the system down for one of two reasons:

1. Get into the single-user state so you can do system administration tasks such as update the system, reconfigure the kernel, or check the file systems, or

2. Shut down the system totally to perform a task such as installing a new interface card.

Prerequisites and Conditions

• Stopping the system improperly can corrupt (damage) the file systems.

N ever stop the system by turning it off!

• Only the system administrator or a designated superuser should shut down the system.

• The / etc/ shutdown command warns users of impending shutdown; halts daemons; kills unauthorized processes; unmounts file systems; puts the system in single user mode; and writes the contents of the 110 buffers to a disk. You see several messages during the process. You should watch them to note actions and possible problems.

• The shutdown command warns all users to log off the system, using a graceperiod you can specify. If you do not specify one, users get 60 seconds to log off. You should notify active users as to when the system will be shut down. Give them enough time to finish their work and log off. You can do this physically or use the / etc/wall or / etc/ cwall commands. The chapter named "Constructing an HP-UX System" has information.

4-18 Starting and Stopping HP-UX

• In an HP-UX cluster, clients need only log off, but the shutdown process works better if you turn the cnodes off. Do not shut down the system from a client; do the work from the root server.

• If you use a network service, do not run shutdown from a remote system via rlogin. The shutdown process logs you out prematurely and returns control to the system console.

• You cannot use SAM to shut down the system, but some SAM tasks shut down to the single-user state, or they ask you to do so.

• See the shutdown(lM) entry in the HP- UX Reference manual for information about options and features.

• The System Administration Concepts manual has information on system shutdown concepts.

Starting and Stopping HP-UX 4-19

Manual Procedures

Going to the Single-user State for Maintenance

1. As the root user, change to the root directory if not already there:

cd /

2. Shut down the system. You have some alternatives for doing this. Also, the shutdown process asks if you want to send a message. If you elect to broadcast a message, respond with y and then type the message. When you finish, press (Return) (or (Enter )), and then (CTRL

)-@).

The following examples show alternatives for shutting down to the single-user state:

shutdown Shuts down to single-user state, allowing the default 60 second graceperiod

shutdown 0 Shuts down the system with no graceperiod

shutdown 30 Begins the shutdown to the single-user state after a 30-second graceperiod

3. While the system is in the single-user state, perform the necessary system administration tasks. When you finish, you can start up the system without turning off anything by executing:

reboot

As always, watch the messages to see that everything is happening correctly.

Some system administration tasks will do the rebooting for you.

4-20 Starting and Stopping HP-UX

Shutting Down the System Completely

1. As the root user, change to the root directory if not already there:

cd /

2. Shut down the system. You have some alternatives doing this. Also, the shutdown process asks if you want to send a message. If you elect to

broadcast a message, respond with y and then type the message. When you finish, press (Return) (or (Enter)), and then (CTRL

l-0.

From the multi-user state, you can shut down the system completely:

shutdown -h

This process is rather harsh and sudden. It is generally better to take the system down in steps:

a. Execute:

shutdown 20 This gets the system into the single-user state, allowing a 20 second graceperiod

b. Execute:

reboot -h This brings the system to a complete stop

You know the system is shut down completely when the system displays halted and pressing a key takes no action.

3. When the system is halted, turn the system off as follows:

a. If you have only a computer (no expander), turn the computer off. Then, turn the devices off as required.

b. If you have a computer and an expander, turn the computer off, turn the expander off, and then turn the devices off as required.

4. When you want to start up the system again, see the earlier procedure for starting up HP- UX.

Starting and Stopping HP-UX 4-21

Shutting Down the System to Activate a New Kernel

You may want to shut down the system only to activate a new kernel. To do this, execute:

shutdown -r 0

The -r option causes the system to reboot immediately after the system gets into the single-user state.

Do not execute shutdown -r from run-level s. You must reboot using the reboot command.

4-22 Starting and Stopping HP-UX

5