LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to switch from one run level to other runleve (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-switch-from-one-run-level-to-other-runleve-4175526332/)

linux_student_007 11-24-2014 06:04 AM

How to switch from one run level to other runleve
 
Hi Team,

I have a situation where to change the runlevel from 3 to 5 without reboot or downtime.

Earlier I heard like there is some command to switch from one runlevel to other runlevel without downtime/reboot.

Thanks in Advance.

pan64 11-24-2014 06:25 AM

see man init, especially "changing runlevels"

linux_student_007 11-24-2014 06:33 AM

Yeah using init we can change run levels. By giving below way we can change runlevel

init 0 - > will shutdown
init 1 -> single usermode
init 3 -> textmode Run level 3
init 5 -> runlevel 5, where you get GUI
init 6 - > reboot

By using above to switch from runlevel 3 to runlevel 5 we need downtime/reboot. But in my case I cannot reboot as it is critical server.

So I am looking for command that will switch run level without downtime.

yancek 11-24-2014 06:49 AM

http://www.techrepublic.com/article/...out-rebooting/

RockDoctor 11-24-2014 08:18 AM

Quote:

Originally Posted by linux_student_007 (Post 5274202)
Hi Team,

I have a situation where to change the runlevel from 3 to 5 without reboot or downtime.

Earlier I heard like there is some command to switch from one runlevel to other runlevel without downtime/reboot.

Thanks in Advance.

I've always used
Code:

telinit X
to change the runlevel (typically 3 to 5 or 5 to 3 in Fedora; doesn't do much for me when running Ubuntu).

EDDY1 11-24-2014 08:23 AM

With systemd in debian the inittab is removed so the runlevel is changed by another file, although I haven't figured out which.

suicidaleggroll 11-24-2014 09:50 AM

Quote:

Originally Posted by EDDY1 (Post 5274243)
With systemd in debian the inittab is removed so the runlevel is changed by another file, although I haven't figured out which.

To switch runlevel on the fly:
systemctl isolate multi-user.target # the equivalent of init 3
systemctl isolate graphical.target # the equivalent of init 5

To change the default runlevel:
systemctl set-default multi-user.target
systemctl set-default graphical.target

EDDY1 11-24-2014 02:15 PM

Thank you suicidaleggroll that's good to know, I haven't seen any good documentation on systemd yet. It took me 4 years to get where I am with linux & 1 update to have to relearn it

Fred Caro 11-24-2014 07:18 PM

I take it the version talked about is Jessie or above? Has systemd been implemented yet in Debian?
'init 1' no longer works?

Fred.

jailbait 11-24-2014 07:59 PM

Quote:

Originally Posted by Fred Caro (Post 5274516)
I take it the version talked about is Jessie or above? Has systemd been implemented yet in Debian?
'init 1' no longer works?

Fred.

I run both wheezy and jessie. wheezy uses sysVinit. jessie uses systemd.

---------------------
Steve Stites

EDDY1 11-25-2014 12:03 AM

Quote:

Originally Posted by Fred Caro (Post 5274516)
I take it the version talked about is Jessie or above? Has systemd been implemented yet in Debian?
'init 1' no longer works?

Fred.

Yes you are correct but the statement is relavent because the OP hasn't stated which OS he/she is using.


All times are GMT -5. The time now is 11:54 PM.