1

I am a newbie in linux using ubuntu 14.04. I came across the concept of runlevels. What confuses me is the fact that when i run the command

who -r

I see that i am in runlevel 2 which represents multi-user, text mode, no servers. Why is it that I still have access to my GUI yet I am in run level 2? I thought that I was in runlevel 4 which is multi-user, GUI mode, no servers. Please I need clarification. Thank you.

muru
  • 197,895
  • 55
  • 485
  • 740
gnsr
  • 1,107
  • Did not know that my question was a duplicate. The answers provided on the link helped me. Thank you – gnsr Mar 29 '15 at 07:01

1 Answers1

2

Ubuntu does not use the concept of Runlevels any more. Ubuntu now uses the new upstart based init which depends solely on the occurrence of an event and then triggering defined response(s) to start/kill programs.

Runlevel on the other hand, is from the old SysV style init daemon that depends on the runlevel to decide which program will start and which will be killed, you need to put the scripts in the defined directories for each runlevel (/etc/rc{0..6}.d).

For the reason of compatibility Ubuntu still supports running SysV runlevels scripts from /etc/rc{0..6}.d based on the runlevel set in the variable DEFAULT_RUNLEVEL of /etc/init/rc-sysinit.conf, but the concept of runlevels is somewhat obsolete and you should not be too much bothered about it.

heemayl
  • 91,753
  • Doesn't Systemd expose run levels with target units so eith ubuntu swapping to systemd is it really obsolete? – damien Mar 28 '15 at 14:23
  • @damien: systemd targets work differently than the SysV runlevels..you can find resemblance with each other but their functionalities are somewhat different.. – heemayl Mar 28 '15 at 17:35