To change the runlevel of a Linux server without rebooting, you can use the telinit
command. The telinit
command allows you to change the runlevel of the system by sending a signal to the init process.
For example, to change the runlevel to 3 (multi-user, non-graphical mode), you can use the following command:
re:ot reflautturi.comsudo telinit 3
This will change the runlevel to 3 and stop all processes that are not required for this runlevel. You can also use the telinit
command to change to other runlevels, such as 2 (multi-user, graphical mode) or 5 (graphical login mode).
Keep in mind that changing the runlevel can affect the availability of certain services, and it is important to carefully consider the impact on your system before making any changes.
It's also worth noting that the systemctl
command can be used to change the runlevel in systems that use the Systemd init system. For example, to change the runlevel to 3 using systemctl
, you can use the following command:
sudo systemctl isolate multi-user.target
This will change the runlevel to 3 and stop all processes that are not required for this runlevel. You can also use the systemctl
command to change to other runlevels, such as graphical.target
for runlevel 5 (graphical login mode).