Runlevels in Ubuntu

BZeto

Platinum Member
Apr 28, 2002
2,428
0
76
I recently installed Ubuntu 7.04 Server. After installing the ubuntu-desktop I wasnt sure how to return to the command line w/networking (single user mode?). I tried 'init 2' at the terminal but nothing changed. 'init 1' takes me back but I have no network settings.

I'm basically just wondering about how the runlevels work in Ubuntu. I know after I installed ubuntu-desktop (gnome i think?) and did 'startx', every time i reboot it takes me directly to the GUI, and I dont really want that. For learning purposes I only want to work in the GUI when I need to.

I've heard about Upstart and how it replaces init or runlevels but I have no clue how it works. Any insight would be appreciated.

Thanks
 

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
14
81
www.markbetz.net
If it's like desktop, then ctrl-alt-f1 through f5 takes you to one of five full-screen terminal sessions. Ctrl-alt-f7 takes you back to the gnome desktop.
 

BZeto

Platinum Member
Apr 28, 2002
2,428
0
76
Originally posted by: Markbnj
If it's like desktop, then ctrl-alt-f1 through f5 takes you to one of five full-screen terminal sessions. Ctrl-alt-f7 takes you back to the gnome desktop.

Yes, those do take me to different tty#'s. But when I type in the 'runlevel' command at each one (including from the terminal window in gnome gui) it outputs 'N 2'. Meaning im at runlevel 2 and there was no previous runlevel. I'm a little confused as to how ubuntu handles runlevels.

It appears there are 2 runlevels, Single User (1) and everything else (2).

 

nweaver

Diamond Member
Jan 21, 2001
6,813
1
0
are you trying to stop gdm/gnome from starting? then update your rc files. I don't remember the command, maybe update-rc or something like that. Remove it from runlevel 2.

Runlevels and GUI's is one drawback I have seen. It makes no sense if you have used Redhat stuff, as runlevel 2 is non gui, runlevel 3 is GUI.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
It appears there are 2 runlevels, Single User (1) and everything else (2).

Yes, by default Debian (and thus Ubuntu) use runlevel 2 for everything. The special runlevels like 5 used by other distros are unnecessary since GDM, KDM, etc are started as normal services via /etc/init.d/*dm so if you want to disable GDM just 'rm /etc/rc2.d/S99gdm'.
 

cleverhandle

Diamond Member
Dec 17, 2001
3,566
3
81
Originally posted by: Nothinman
...so if you want to disable GDM just 'rm /etc/rc2.d/S99gdm'
Better to do...

mv /etc/rc2.d/S99gdm /etc/rc2.d/K01gdm

That way the service will get shut down if you want to keep it activated in other runlevels and switch between them. Also, if you just remove the link it will (at least sometimes) get recreated whenever you update the package, depending on how the maintainer uses the update-rc.d script.

 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
True, I didn't think of that. Mostly because I don't see a reason not to use X on a desktop, if you want to mess with the CLI just startup gnome-terminal, xterm, etc.
 

BZeto

Platinum Member
Apr 28, 2002
2,428
0
76
I think I'll just leave GDM running and work from the GUI terminal. I'm not running anything too intensive that X will have an real impact on system performance.
But is there a reason I cannot login through GDM as root?

Also, can I activate a sort of permanent sudo privilege mode until I logout or something? I wouldnt want to do this often, but occasionally when I'm doing alot of admin tasks it seems like it would be helpful.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
But is there a reason I cannot login through GDM as root?

Because it's a terrible idea, run X as your normal user and use su or sudo only as necessary.

Also, can I activate a sort of permanent sudo privilege mode until I logout or something? I wouldnt want to do this often, but occasionally when I'm doing alot of admin tasks it seems like it would be helpful.

sudo -s gives you a shell.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Originally posted by: BriGy86
from what I know it seems most Debian distros have set the GUI to run in runlevels 2-5

I wasn't sure how to change this in any config file so I went with Mepis, I'll see if I can find the article for you.

*EDIT*
http://www.debianhelp.co.uk/runlevels.htm

The main reason I like to be able to go to command line only is because of installs like this
http://www.nvidia.com/object/l...ay_ia32_100.14.11.html

You don't have to shutdown X to install the nVidia driver, everything can be done while X is running and then you just have to restart X afterwards. Obviously if something isn't right X won't start again but that's true in either case. You really shouldn't install the nVidia driver that way anyway. Their script moves files around that the package manager is supposed to take care of so it can cause problems on upgrades whenever the package manager unknowningly overwrites nVidia's special copies of the files.
 
Jun 26, 2007
11,925
2
0
Originally posted by: Nothinman
Originally posted by: BriGy86
from what I know it seems most Debian distros have set the GUI to run in runlevels 2-5

I wasn't sure how to change this in any config file so I went with Mepis, I'll see if I can find the article for you.

*EDIT*
http://www.debianhelp.co.uk/runlevels.htm

The main reason I like to be able to go to command line only is because of installs like this
http://www.nvidia.com/object/l...ay_ia32_100.14.11.html

You don't have to shutdown X to install the nVidia driver, everything can be done while X is running and then you just have to restart X afterwards. Obviously if something isn't right X won't start again but that's true in either case. You really shouldn't install the nVidia driver that way anyway. Their script moves files around that the package manager is supposed to take care of so it can cause problems on upgrades whenever the package manager unknowningly overwrites nVidia's special copies of the files.

Actually, using the Nvidia installer you have to shut down X first but it's not all that hard in Ubuntu or Debian, just shift to TTY1 and kill gdm and install it and then you restart gdm (or kdm in either case if that is what you use)

The Nvidia installer will exit with an error if you try to run it while X is running, unless there is some switch to fix that, i dunno, i haven't looked into it much.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
The Nvidia installer will exit with an error if you try to run it while X is running, unless there is some switch to fix that, i dunno, i haven't looked into it much.

Then that's a bug in their installer and yet another reason why you should avoid using it.
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |