Szukaj na tym blogu

środa, 8 czerwca 2011

As any unix like operating system, Solaris 10 and RHEL5 have also run levels in which system can operate. Run levels describes particular behaviors system can provide.

SOLARIS10

ID Description
0 Operating system halted; (SPARC only) drop to PROM monitor
S Single-User mode with only root filesystem mounted (as read-only)
1 Single-User Administrative mode with all local filesystems mounted (read-write)
2 The system is supporting multiuser operations. Multiple users can access the system. All system daemons are running ecept NFS Server and some other network resource server related daemons.
3 Multi-User mode; identical to 2 (runlevel 3 runs both /sbin/rc2 and /sbin/rc3), with filesystems exported, plus some other network services started.
4 Alternative Multi-User mode, User-definable
5 Shut down, power-off if hardware supports it
6 Reboot

RHEL/Fedora

ID Description
0 Halt
1 Single-User mode
2 Multi-user mode console logins only (without networking)
3 Multi-User mode, console logins only
4 Not used/User-definable
5 Multi-User mode, with display manager as well as console logins (X11)
6 Reboot


RHEL5 maintenance run levels

1
Activates SELinux; runs /etc/rc.sysinit, which checks & mounts filesystems; executes all scripts in /etc/rc1.d directory.
S
Single user mode; activates SELINUX; runs /etc/rc.sysinit, which checks & mounts filesystems.
Emergency
emergency boot mode; activates SELinux; mounts only root filesystem
init=/bin/sh
emergency boot mode; mounts only root filesystem.

Run levels 1, S can be accessed from running RHEL5 system by using init 1 or init S but emergency and init=/bin/sh can only be accessed from within grub menu as a parameter to kernel.
Here is the procedure that applies to "emergency" run level but the same is for "init=/bin/sh" run level only have to exchange keyword "emergency" for "init=/bin/sh" :

1. during boot linux, press any key to enter GRUB menu

2. Press a button to modify kernel arguments before booting

3. at the end of kernel arguments add 'emergency' keyword

4. press enter and linux boots in emergency run level

If you want to restart the machine from "maintenance run level" you have to type exit command.


RHEL5 Virtual Consoles during installation

ALT+F1
Text installation display; if you're running in graphical mode, it includes the basic commands to start graphics drivers.
ALT+F2
Accesses a bash shell prompt; available after the first few installation steps.
ALT+F3
Lists the log of installation messages; if network problems occur, you may see related messages here.
ALT+F4
Displays all kernel messages, including detected hardware and drivers.
ALT+F5
Installation displays partition formatting; nothing is shown here until Anaconda formats the actual partitions.
ALT+F6
Graphical installation display; active only if you're running the installation program in graphical mode (was formerly available from ALT-F7). Naturally, if you're installing in text mode, nothing is shown in this console.

If you are installing RHEL5 in text mode you can access those consoles by using ALT key of you are in gui installation mode you have to add CTRL key to these combinations e.g. CTRL+ALT+F1, CTRL+ALT+F2, etc.


RHEL5 virtual consoles after installation

CTRL+ALT+F1 text terminal session
CTRL+ALT+F2 text terminal session
CTRL+ALT+F3 text terminal session
CTRL+ALT+F4 text terminal session
CTRL+ALT+F5 text terminal session
CTRL+ALT+F6 text terminal session
CTRL+ALT+F7 gui session with X server
CTRL+ALT+F8 gui session with X server
CTRL+ALT+F9  gui session with X server
CTRL+ALT+F10 gui session with X server
CTRL+ALT+F11 gui session with X server
CTRL+ALT+F12 gui session with X server

More about linux shortcuts which apply to all distros can be read here.


SOLARIS10 shutdown procedures

You can shutdown, restart and change run level in SOL10 by using these commands :
- # init
- # shutdown
- # poweroff
- # halt
- # reboot

Commands :poweroff, reboot, halt perform an immediate system shutdown. They do not execute the rc0 scripts, don't notify logged-in users and there is no grace period.

Command init informs svc.startd daemon of change in run level. This daemon achieves the appropriate milestone and ultimately executes the rc0 kill scripts. Doesn't notify logged-in users and there is no grace period.

Command shutdown is a script that invokes the init daemon to shut down, power off and restart the system. It executes the rc0 kill scripts to shut down processes and apps gracefully. It also :
- notifies all logged-in users that system is being shut down,
- delays the shut down by 60 s by default
- enables to include an optional descriptive message to inform users of what will transpire


shutdown / init commands
- Shut down to single user mode
# init s
or another cmd
# shutdown

- Shut down the system to stop Solaris OS, and display the ok prompt
# init 0
or another cmd
# shutdown -i 0

- Shut down the system and turn off power
# init 5
or another cmd
# shutdown -i 5

- Shut down the system and automatically, reboot to multiuser.
# init 6
or another cmd
# shutdown -i 6

- Shut down the system and then reboot to multiuser mode, answer yes to the question presented, provide a grace period of 2 minutes and provide a message to the users.
# shutdown -y -g 120 -i 6 "The system is being rebooted"



poweroff, halt, reboot commands
# halt
# poweroff
# reboot

The image below shows boot, shutdown runlevel transition.



Brak komentarzy:

Prześlij komentarz