nixCraft Linux / UNIX / Shell Scripting Forum

nixCraft

Linux / UNIX Tech Support Forum

Ubuntu Set Default Runlevel /etc/inittab

This is a discussion on Ubuntu Set Default Runlevel /etc/inittab within the Linux software forums, part of the Linux Getting Started category; Hi everyone, As I read some linux books, and most of them are saying there are 6 run levels in ...


Register free or login to your account to remove all advertisements.

Go Back   nixCraft Linux / UNIX / Shell Scripting Forum > Linux Getting Started > Linux software

Linux answers from nixCraft.


Linux software General questions and discussion about Redhat/Fedora Core/Cent OS, Debian and Ubuntu Linux related to softwares should go here.

Reply

 

Thread Tools Display Modes
  #1 (permalink)  
Old 5th June 2007, 07:22 AM
Member
 
Join Date: May 2007
Posts: 56
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 4
lacloai is on a distinguished road
Default Ubuntu Set Default Runlevel /etc/inittab

Hi everyone,

As I read some linux books, and most of them are saying there are 6 run levels in linux. My Desktop computer is running on SuSe 10, which I can change the default run leve very easy by editting the file called /etc/inittab. However, I coudn't figure out how to do with Ubuntu. It looks like Ubuntu doesn't have /etc/inittab file . So, does anyone in here know how to change the default run level for Ubuntu 6.10 ? I mean to change it permanently so that it will boot straight to it. For example runlevel 3. I believe that there must be a file so that it can be modified for the certain runlevel. Please reply. I would like to know the idea/response or at least somebody will say something to make this forum a little bit more active. Thank you. Very apreciate that.
Reply With Quote
  #2 (permalink)  
Old 5th June 2007, 10:06 AM
nixcraft's Avatar
Never say die
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash, Perl, Python
Posts: 3,294
Thanks: 13
Thanked 411 Times in 304 Posts
Rep Power: 10
nixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond repute
Default

There is ni /etc/inittab file in Ubuntu because Ubuntu has /etc/event.d/rc-default file

You can fix this problem by editing /etc/event.d/rc-default file
First backup file,
Code:
sudo cp /etc/event.d/rc-default /etc/event.d/rc-default.bakup
Open vi /etc/event.d/rc-default
Code:
sudo vi /etc/event.d/rc-default
Find all lines read as - telinit 2 and replace with telinit 3
Code:
telinit 3
Reboot the system
__________________
Vivek Gite
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Do you run a Linux? Let's face it, you need help!
Cricket & IPL News Blog

Last edited by nixcraft; 25th September 2009 at 12:12 PM.
Reply With Quote
  #3 (permalink)  
Old 6th June 2007, 07:54 AM
Member
 
Join Date: May 2007
Posts: 56
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 4
lacloai is on a distinguished road
Default Hi

Thanks a lot for your reply. However, I can't change it to the way it works in SuSe. For instance, I can change it to boot straight to the command with no X server. All I do in SuSe is do this in /etc/inittab and make it like this id:3:initdefault

Looks like to me Ubuntu has only 2 runlevels. One is single user mode (that's is 1) and another is for all with GUI (that's is from 2 to 5). That's kind of turn me down. Say, if someone wants to use Ubuntu to run for a file server, and she/he only needs to run with full multiuser with network without GUI. That's impossible. Right? Because you can't change it to telinit 1 sine that is single user mode only. I like the traditional way like Redhat and SuSe, which have 6 runlevels. Also, after I modified the file in /etc/event.d/rc-default and change to telinit1 for single user mode, my machine didn't pass the reboot. It's hanging right before it loads windows manager.

I don't know if anyone in here know how to make Ubuntu boot straight to the command line without GUI involved? I heard about upstart? Did anyone use this kind of thing yet? Please helppppppppppp. Very appreciate that.
Reply With Quote
  #4 (permalink)  
Old 7th June 2007, 02:22 AM
tom tom is offline
Contributors
 
Join Date: Jun 2005
Location: London, UK
Posts: 213
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 6
tom is on a distinguished road
Default

vivek is correct, there is no /etc/inittab file and /etc/event.d/rc-default is default upstart config file. After above modification type the command
Code:
sudo apt-get install rcconf
sudo rcconf
Turn off GDM or Gnome and save change and reboot the system. Rcconf allows you to control which services are started when the system boots up or reboots. It displays a menu of all the services which could be started at boot. The ones that are configured to do so are marked and you can toggle individual services on and off. So you will be dropped into text mode and no GUI.
Reply With Quote
  #5 (permalink)  
Old 9th June 2007, 06:54 AM
Member
 
Join Date: May 2007
Posts: 56
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 4
lacloai is on a distinguished road
Default Hi

Thanks a lot for that. I'll give it a try this weekend and see how it goes. Very appreciate that.
Reply With Quote
  #6 (permalink)  
Old 9th November 2008, 09:13 PM
Junior Member
 
Join Date: Nov 2008
OS: Ubuntu
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
mxyzptlk2063 is on a distinguished road
Default How to disable the GUI in Ubuntu

Hi,

I know this topic is slightly old, but I think maybe the next generations can learn from this:

lacloai posted this message long time ago:


"Say, if someone wants to use Ubuntu to run for a file server, and she/he only needs to run with full multiuser with network without GUI. That's impossible. Right? Because you can't change it to telinit 1 sine that is single user mode only."

Of course this is not true, and we should not quickly point people to download some magic "runlevel setup helper" tools. The original problem was to avoid loading GUI on boot. It was correctly answered how to change the default runlevel to level 3 under Ubuntu, but then you should only disable the gdm at runlevel 3 in the config files in order to get rid of the hated GUI like this:

1.) cd /etc/rc3.d
2.) sudo mv S30gdm K70gdm

This should do the trick. To get more info why you shall do it like this enter the command "cat /etc/rc3.d/README" and you'll get it.

May the GUI also be added to runlevel 2, you can also disable it in "/etc/rc2.d" like in the example above.

HTH,
Mx
Reply With Quote
  #7 (permalink)  
Old 18th November 2008, 05:42 AM
Junior Member
 
Join Date: Nov 2008
OS: Ubuntu
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
pyeatman is on a distinguished road
Default

I'm surprised that no one suggested installing Ubuntu server (vs. desktop) which sounds to me to be what the original poster may be wanting.
Reply With Quote
  #8 (permalink)  
Old 24th September 2009, 09:13 PM
Junior Member
 
Join Date: Sep 2009
OS: Ubuntu
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
rforth is on a distinguished road
Default

Quote:
Originally Posted by pyeatman View Post
I'm surprised that no one suggested installing Ubuntu server (vs. desktop) which sounds to me to be what the original poster may be wanting.

Agreed.

I know this is going to sound a bit corny and "after the fact" but I was reading this thread and registered just to say that.

I was looking up info about runlevels for my linux+ exam and as an newbie Ubuntu desktop user I find this thread very useful as I prefer starting up in runlevel 3 nowadays so I will give this a go later. I didnt think it was possible in ubuntu actually so made a refreshing read.

Im a windows guy by trade you see but I have been using linux in various forms at home for a while now and settled on Ubuntu as is seems like a nice distro for ex-windows people. I can see the frustrations some people might have with it especially the desktop version, ie it does make some assumptions about the user and things like the runlevel which other distros like red hat / fedora don't, but at the end of the day if you are like me and dont actually know what you are doing maybe it is not such a bad thing.

I think the server version doesnt make as many assumptions as the desktop version so should be easier to manage. especially if you don't want a gui fullstop its a good one to try.

Last edited by rforth; 24th September 2009 at 09:20 PM. Reason: Spelling mitsakes < Irony
Reply With Quote
  #9 (permalink)  
Old 25th September 2009, 12:15 PM
nixcraft's Avatar
Never say die
 
Join Date: Jan 2005
Location: BIOS
OS: RHEL
Scripting language: Bash, Perl, Python
Posts: 3,294
Thanks: 13
Thanked 411 Times in 304 Posts
Rep Power: 10
nixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond reputenixcraft has a reputation beyond repute
Default

Guess I'm lazy and I don't wanna reinstall. You can turn desktop into server or vice versa, provided that you know everything about OS. Otherwise, reinstalltion or virtualbox is also good choice while playing with operating systems.
__________________
Vivek Gite
Be proud RHEL user, and let the world know about your enterprise choices! Join RedHat user group.
Do you run a Linux? Let's face it, you need help!
Cricket & IPL News Blog
Reply With Quote
Reply

Tags
run level, telinit, ubuntu, ubuntu change runlevel


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Default webpage anichhatre Getting started tutorials 5 15th December 2008 02:41 AM
howto update inittab amsreeku Linux software 2 2nd September 2007 07:36 PM
Runlevel in Linux 009satya Networking, Firewalls and Security 4 6th March 2007 08:21 PM
Ubuntu Linux runlevel and its meaning Linux software 1 20th July 2006 11:28 PM
Default Route puppen Linux software 2 26th April 2006 11:33 PM


All times are GMT +5.5. The time now is 08:26 AM.


Powered by vBulletin® Version 3.8.6 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2010 nixCraft. All rights reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40