LinuxQuestions.org
Register a domain and help support LQ
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 03-19-2014, 10:15 PM   #1
Fred Caro
Member
 
Registered: May 2007
Posts: 999

Rep: Reputation: 166Reputation: 166
change runlevel


on a runing pc I can change to runlevel 1 on Debian but not on Ubuntu or Mint, why is this?
Fred.
 
Old 03-19-2014, 10:16 PM   #2
redd9
Member
 
Registered: Nov 2013
Location: Canada
Distribution: Ubuntu
Posts: 80
Blog Entries: 4

Rep: Reputation: 42
Have you tried modifying the file /etc/inittab?
 
Old 03-19-2014, 10:39 PM   #3
Fred Caro
Member
 
Registered: May 2007
Posts: 999

Original Poster
Rep: Reputation: 166Reputation: 166
No I have n't but it is sub-divided.

Fred.
 
Old 03-20-2014, 12:51 AM   #4
AwesomeMachine
Senior Member
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora
Posts: 1,923

Rep: Reputation: 278Reputation: 278Reputation: 278
Maybe you have to use the full path to init:

/sbin/init

like so:

# sudo /sbin/init 1
 
Old 03-20-2014, 02:09 AM   #5
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
Hi,
Quote:
Originally Posted by Fred Caro View Post
on a runing pc I can change to runlevel 1 on Debian but not on Ubuntu or Mint, why is this?
By default Debian runs a different init system (sysvinit) to Ubuntu (upstart). I think Mint init may be upstart too. However, that in itself is not an answer to your question. For an answer you'll need to tell us what method(s) you are using to try to change the runlevel. Eg are you using telinit?

Evo2.
 
Old 03-20-2014, 09:20 PM   #6
Fred Caro
Member
 
Registered: May 2007
Posts: 999

Original Poster
Rep: Reputation: 166Reputation: 166
On all tries I used 'telinit 1' as root and sudo, sudo being without further additions, such as '-' . 'su' used to switch to root on Debian and 'sudo' used on Mint/Ubuntu.

Fred.
 
Old 03-20-2014, 11:24 PM   #7
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,131
Blog Entries: 2

Rep: Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833Reputation: 4833
It would help if you tell us what actually happens on your system when you run that command. Do you get an error message? Does nothing happen? Do you see messages about stopped services after running that command?
 
Old 03-21-2014, 11:05 AM   #8
Yaro
Member
 
Registered: Nov 2008
Posts: 41

Rep: Reputation: 21
Quote:
Originally Posted by Fred Caro View Post
on a runing pc I can change to runlevel 1 on Debian but not on Ubuntu or Mint, why is this?
Fred.
Because Debian uses System V Init and Ubuntu and Mint use Upstart, which don't have the runlevel facility. Debian will be switching to systemd in Jessie (Which means Debian Sid and Testing are likely to be switched over to it very soon.). Systemd also has no "runlevels" per se but something called "targets" which are more fine-grained and easier to define. But neither upstart or systemd have an "init <runlevel>" command.

As a result of the impending Debian change, Ubuntu and likely Mint are going to jump to systemd as well, as Ubuntu's package ecosystem is pretty much just a stabilized Debian Sid snapshot with some Canonical-driven junk mixed in.

Just run the "reboot" (Same as init 6.) or "poweroff" (Same as init 0) commands via root or sudo. They're commands independent of init implementation and will work with SysVInit, Upstart, and systemd no problem. Refer to Upstart or systemd documentation to figure how to get into "single" mode as that's a heavily implementation-reliant runlevel.
 
Old 03-22-2014, 06:04 PM   #9
Fred Caro
Member
 
Registered: May 2007
Posts: 999

Original Poster
Rep: Reputation: 166Reputation: 166
Thanks for replies. When I run '
Code:
sudo telinit 1
' Ubuntu goes to its logout screen as if it is shutting down but then just gets stuck. Pressing Esc does nothing... perhaps if I waited long enough..? I could try Ctrl+Alt+Backspace to shutdown to graphics first, or '
Code:
sudo /etc/init.d/xdm stop
', (not sure if these commands are still current/correct) and then change runlevel would work.
It's odd that using 'runlevel' returns the expected values but the only means to change it would be at boot time although if systemd comes in it could be academic.
 
  


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
MES5 in runlevel 3 stuck after starting mavisd. Can't change back to runlevel 5 JnPson Linux - Enterprise 3 01-16-2013 06:58 PM
cannot change to runlevel 3 nick623 Red Hat 2 07-18-2006 01:37 AM
Change runlevel jstephens84 Debian 4 01-02-2006 06:25 PM
Change runlevel Quiber Linux - Software 1 01-11-2005 12:27 AM
how do i change my runlevel pguru Linux - Newbie 5 08-13-2004 02:51 PM


All times are GMT -5. The time now is 10:56 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