Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Changing run levels in Linux

 
Joe Harry
Ranch Hand
Posts: 10091
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Guys,

I'm not finding the /etc/inittab file under /etc on my Linux (Ubuntu 9.10). How and where can I change the runlevel? Below is what I get when I listed the files under /etc/ (just showing a partial list here that starts with i).




 
Tim Holloway
Saloon Keeper
Pie
Posts: 18020
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think what you really meant what "How can I change the default runlevel?". Since that's what's set in inittab.

I'm puzzled. I'm pretty sure that inittab is wired in pretty tightly to the boot process, in addition to being in charge of respawning critical processes. The only way I can see that you could function without one is if the inittab is in an initial boot image that's been swapped out via a pivot chroot operation as part of the later-stage booting where the boot disk is replaced by the root disk.
 
Joe Harry
Ranch Hand
Posts: 10091
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tim Holloway wrote:I think what you really meant what "How can I change the default runlevel?". Since that's what's set in inittab.

I'm puzzled. I'm pretty sure that inittab is wired in pretty tightly to the boot process, in addition to being in charge of respawning critical processes. The only way I can see that you could function without one is if the inittab is in an initial boot image that's been swapped out via a pivot chroot operation as part of the later-stage booting where the boot disk is replaced by the root disk.


So what do I do now to change the default runlevel?
 
Stefan Wagner
Ranch Hand
Posts: 1923
Linux Postgres Database Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ubuntu abandoned inittab in one of the latest releases, that's right.

One way is, if you boot with grub, to interrupt, (e)dit the command line, insert the desired runlevel at the end of the command and press (b)oot, to switch the runlevel on a per-boot basis.
Consequently, you may choose the runlevel in the grup-menu-file (which happens to be changed as well, so you need to find out how to modify the menu - edits to /boot/grub/menu.lst will be overriden by some update-processes).

This would boot to runlevel 3.

The right way in general seems more easy:
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic