Thursday, April 8, 2010

Unix operating states


Multi user mode
 Normal machine state
 User can log in
 File systems are mounted in
 Most services and daemons are running

Single user mode

 Required for some admin tasks
 Only root login is enabled
 Non –critical file systems are mounted
 Non-critical daemons are shut down
Halt state
 Nothing is running

Note

Use the shutdown and reboot commands to properly move between single-user mode, multiuser mode, and the halt state as shown in the diagram on the slide.
The shutdown Command Details
Executing the shutdown command stops system activities in an orderly and consistent manner. The shutdown command performs the following tasks:
Prompts the administrator for a broadcast message to send to all users.
Broadcasts the warning message to all user terminal sessions.
Grants a 60 second (by default) grace period for users to log out.
Kills all user logins.
Shuts down all non-critical processes.
Unmounts all non-critical file systems.

Depending on the option specified, shutdown will either leave the system in single-user mode (no options), the halt state (if -h was specified), or initiate a reboot (if -r was specified).

Common shutdown options:
# shutdown -hy 600 # shutdown to a halt state in 600 seconds.
# "-y" (yes) option prevents shutdown from
# requesting confirmation before proceeding.

# shutdown -ry 600 # reboot in 600 seconds without requesting confirmation.

# shutdown -ry 0 # reboot immediately without requesting confirmation.
Reboot Command Details
The reboot command uses "kill -9" to kill running processes, which takes the system down quickly, but can cause problems for applications and file systems. The shutdown command shuts down applications and processes more gracefully, and thus is the preferred method for halting or rebooting the system from multiuser mode. Reboot may be used if:
The system is already in single-user mode.
You need to bring the system down very quickly.

Common reboot options: (For a complete list of options, see the man page for reboot (1m))

# reboot –h # shutdown to a halt state (only use this from single-user mode).
# reboot # reboot

No comments:

Post a Comment