LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-24-2014, 07:04 AM   #1
linux_student_007
LQ Newbie
 
Registered: Jul 2014
Posts: 7

Rep: Reputation: Disabled
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.
 
Old 11-24-2014, 07:25 AM   #2
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 8,133

Rep: Reputation: 2272Reputation: 2272Reputation: 2272Reputation: 2272Reputation: 2272Reputation: 2272Reputation: 2272Reputation: 2272Reputation: 2272Reputation: 2272Reputation: 2272
see man init, especially "changing runlevels"
 
Old 11-24-2014, 07:33 AM   #3
linux_student_007
LQ Newbie
 
Registered: Jul 2014
Posts: 7

Original Poster
Rep: Reputation: Disabled
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.
 
Old 11-24-2014, 07:49 AM   #4
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 6,872

Rep: Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249
http://www.techrepublic.com/article/...out-rebooting/
 
Old 11-24-2014, 09:18 AM   #5
RockDoctor
Senior Member
 
Registered: Nov 2003
Location: Minnesota, US
Distribution: Fedora, Linux Mint, Ubuntu
Posts: 1,506

Rep: Reputation: 325Reputation: 325Reputation: 325Reputation: 325
Quote:
Originally Posted by linux_student_007 View Post
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).
 
Old 11-24-2014, 09:23 AM   #6
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,838

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
With systemd in debian the inittab is removed so the runlevel is changed by another file, although I haven't figured out which.
 
Old 11-24-2014, 10:50 AM   #7
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,260

Rep: Reputation: 1948Reputation: 1948Reputation: 1948Reputation: 1948Reputation: 1948Reputation: 1948Reputation: 1948Reputation: 1948Reputation: 1948Reputation: 1948Reputation: 1948
Quote:
Originally Posted by EDDY1 View Post
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
 
1 members found this post helpful.
Old 11-24-2014, 03:15 PM   #8
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,838

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
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
 
Old 11-24-2014, 08:18 PM   #9
Fred Caro
Member
 
Registered: May 2007
Posts: 999

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

Fred.
 
Old 11-24-2014, 08:59 PM   #10
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Jessie, Linux Mint 17
Posts: 7,751

Rep: Reputation: 272Reputation: 272Reputation: 272
Quote:
Originally Posted by Fred Caro View Post
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
 
Old 11-25-2014, 01:03 AM   #11
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,838

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
Quote:
Originally Posted by Fred Caro View Post
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
initializing run level 4 at inittab default level Gerwar Linux - General 3 01-17-2011 05:38 PM
Keyboard not working at run level 3 and 5, but ok at level 2 ks2andrew Red Hat 1 06-17-2010 10:17 AM
Can't switch to TTY or run level 3 from run level 5 reemfz Fedora 3 06-01-2009 09:06 AM
set your default run level so you will boot to a default run level - vga console Adam555 Linux - Newbie 1 01-21-2008 05:55 PM
emacs in run level 3 then switch to X (level 7) then back to level 3 dsoliver Slackware 3 09-01-2006 04:31 AM


All times are GMT -5. The time now is 01:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration