Oracle Linux and Solaris runlevels
A runlevel is a preset operating state on a Unix-like operating system.
A system can be booted into (i.e., started up into) any of several runlevels, each of which is represented by a single digit integer. Each runlevel designates a different system configuration and allows access to a different combination of processes (i.e., instances of executing programs).
The are differences in the runlevels according to the operating system. RHEL 6 and Solaris have runlevels 0 through 6 although the meanings are different. In RHEL 7 a runlevel is known as a target.
Runlevel/Target | Meaning | ||
---|---|---|---|
OEL 6 / Solaris | OEL 7 | OEL | Solaris |
0 | poweroff.target | Power-off state | OS stopped, OBP still running |
s (or S) | Single user | ||
1 | rescue.target | Single user | System management state |
2 | not used | Multi-user (no NFS) | |
3 | multi-user.target | Multi-user | Multi-user (default) |
4 | not used | multi-user (user defined services) | |
5 | graphical.target | X window (default) | Power-off state |
6 | reboot.target | OS restart | OS restart |
The Solaris OS runlevels to keep in mind are 0 (OS stopped), s (single-user), 3 (multi-user), 5 (power-off) and 6 (restart).
OS boot/stop commands
Basic Operation | Oracle Enterprise Linux | Oracle Solaris | |
---|---|---|---|
OEL 6 | OEL 7 | ||
Start OS | Start from the GRUB menu | Start from the GRUB2 menu | Execute the start command from the
OBP (OpenBoot PROM) environment.
{0} ok boot |
Start in single-user mode | Add a runlevel.kernel /vmlinuz-... root=... 1 |
Add a runlevel.systemd.unit= rescue.target |
Start in single user mode from the OBP (OpenBoot PROM) environment. {0} ok boot -s |
Stop OS | Specify the stop option (-h) in the shutdown command.# shutdown -h now |
Specify the stop option
(poweroff) in the systemctl
command.
# systemctl poweroff |
Execute the shutdown command. Specify the stop option (-i5).# shutdown -y -g0 -i5 |
Restart OS | Specify the restart option (-r) in the shutdown command.# shutdown -r now |
Specify the restart option (reboot) in the systemctl command.# systemctl restart |
Execute the shutdown command. Specify the restart option (-i6).# shutdown -y -g0 -i6 |
Other examples | Stop at 10 o'clock.# shutdown -h 10:00Stop after 5 minutes. # shutdown -h +5 |
Suspend the OS.# systemctl suspendHibernate the OS # systemctl hibernate |
Start via network{0} ok boot net:dhcpRestart after 30 seconds # shutdown -y -g30 -i6 |