Linux change the runlevel for a server without rebooting

Q. How do I change the runlevel for a Linux server without rebooting my server? I am using Gentoo Linux.

A. Almost all Linux distribution use init program to change runlevel. init is the parent of all processes. Its primary role is to create processes from a script stored in the file
/etc/inittab . This file usually has entries which cause init to spawn gettys on each line that users can log in. It also controls autonomous processes required by any particular system.

To change runlevel from 3 to 1 you need to type command as follows:
# init 1
OR
$ sudo init 1

Where 1 is runlevel number, other possible runlevel values are:
=> 0 – Shutdown server
=> 1 – Take server to single-user mode
=> 2 – Start X Window (used by Debian)
=> 3 – Full multi-user text mode
=> 5 – Start X Window
=> 6 – Reboot server

Posted by: SXI ADMIN

The author is the creator of SXI LLC and a seasoned sysadmin, DevOps engineer, and a trainer for the Linux operating system/Unix shell scripting. Get the latest tutorials on SysAdmin, Linux/Unix and open source topics via RSS/XML feed or weekly email newsletter.