LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 05-29-2015, 04:20 AM   #1
Weapon S
Member
 
Registered: May 2011
Location: Netherlands
Distribution: Debian, Archlinux
Posts: 262
Blog Entries: 2

Rep: Reputation: 49
Do I understand the runlevels correctly?


This is the first time I've dealt with runlevels, and it seems Debian is an exception in the Linux world.
My question is whether I understand this correctly: (please excuse the crummy GIMP job)
http://www.linuxquestions.org/questi...1&d=1432890577
I've installed a service that starts in runlevel 1 (which as far as I can tell only is entered after runlevel 2) to update the system.
Attached Thumbnails
Click image for larger version

Name:	drlevel.png
Views:	72
Size:	36.2 KB
ID:	18589  
 
Old 05-29-2015, 06:11 AM   #2
kmhuntly
Member
 
Registered: Mar 2015
Location: Cheektowaga, NY
Distribution: ArchLinux
Posts: 34

Rep: Reputation: 7
Do I understand the runlevels correctly?

runlevels are not executed sequentially, and 2 doesn't call 1 (or 3 calling 4, etc). the desired run level is executed directly, so if its run level 5 for multi-user with GUI init goes directly to rc.5, it doesn't go through 1-4 first.
 
1 members found this post helpful.
Old 05-29-2015, 07:51 PM   #3
Fred Caro
Senior Member
 
Registered: May 2007
Posts: 1,007

Rep: Reputation: 167Reputation: 167
Debian seems to use runlevel 0,1,2,6

0=shutdown
1=single user
2=multi-user+gui, if gui is installed
6=reboot

3 (multi-user,no gui, appears to be missing)

Perhaps someone else can enlighten further?

Fred.
 
Old 05-29-2015, 08:33 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,691

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
debian run levels 3,4 and 5 are the same as 2.
http://www.debian-administration.org..._to_run-levels
 
Old 05-29-2015, 09:12 PM   #5
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
A runlevel is nothing more than a bunch of scripts being executed when a runlevel is entered or exited. By convention 1 is single user, 6 is reboot and (I think 7 is halt).

RedHat derivatives use 3 for text mode and 5 for GUI. Debian uses 2 for GUI.

There is no convention for runlevels 2-5 so anyone can use them at will. However Debian seems to go here against the most common use of RL=3 for GUI.

Runlevels are not executed in sequence, but you can call one runlevel from the other. So start in RL=1 in single user mode and then change to RL=2 or RL=5 to get a GUI. But you can even do that manually.

jlinkels
 
Old 05-30-2015, 02:59 AM   #6
Weapon S
Member
 
Registered: May 2011
Location: Netherlands
Distribution: Debian, Archlinux
Posts: 262

Original Poster
Blog Entries: 2

Rep: Reputation: 49
Quote:
Originally Posted by kmhuntly View Post
runlevels are not executed sequentially
Thank you for clearing that up. I am pretty certain Debian starts out in runlevel S though, and uses 6 for reboot. I am not sure where and when runlevel 1 comes into play with Debian.
Quote:
Originally Posted by jlinkels
A runlevel is nothing more than a bunch of scripts being executed when a runlevel is entered or exited.
As I understand it only when entered.
 
Old 05-30-2015, 03:27 AM   #7
fatmac
LQ Guru
 
Registered: Sep 2011
Location: Upper Hale, Surrey/Hants Border, UK
Distribution: Mainly Devuan, antiX, & Void, with Tiny Core, Fatdog, & BSD thrown in.
Posts: 5,483

Rep: Reputation: Disabled
Run levels are a way of setting up a computer in different ways for different use cases.
You can create your own by using 2~5, ( runlevels 0,1,& 6 are usually predefined & would cause great confusion if altered).
eg: Single user - multi user console - multi user GUI - with wifi - without wifi - etc, etc.
 
Old 05-30-2015, 06:28 AM   #8
Head_on_a_Stick
Senior Member
 
Registered: Dec 2014
Location: London, England
Distribution: Debian stable (and OpenBSD-current)
Posts: 1,187

Rep: Reputation: 285Reputation: 285Reputation: 285
Debian 8 no longer uses runlevels.
http://www.freedesktop.org/wiki/Soft...skedQuestions/
 
Old 05-30-2015, 07:12 AM   #9
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
Quote:
Originally Posted by Weapon S View Post
As I understand it only when entered.
The correct explanation is that each runlevel defines a number of services which should be stopped and services which should start. The services which must be stopped when entering a runlevel have a symbolic link name Knn<scriptname> and those which must be started Snn<scriptname>.
Indeed is the stopping and starting only defined when a runlevel is entered.

jlinkels
 
Old 05-30-2015, 09:15 AM   #10
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,691

Rep: Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894Reputation: 5894
Quote:
Originally Posted by Head_on_a_Stick View Post
True, debian 8 uses systemd but the OP did not post the currently running version.
 
Old 05-30-2015, 09:32 PM   #11
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,558
Blog Entries: 15

Rep: Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097
Generally you run a system in 3 stages.

Stage 1: booting - init brings up kernel and activates core system services like udev and networking.
Stage 2: cruising - init or service supervisor activates non-core services and enters usermode for general usage.
Stage 3: halting - init halts system services for reboot or shutdown sequences.

This is universal to any init system. What constitutes a runlevel is a configuration of services launched at stage 2 for the user of the system. Systemd actually does use runlevels, but uses an open ended configuration similar to s6, runit, OpenRC, and such where the system admin can add or remove services ran from the default system runlevel before the login prompt is activated.

Last edited by ReaperX7; 05-30-2015 at 09:36 PM.
 
  


Reply



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
[SOLVED] Wicd won't install correctly/run correctly (64-bit Slackware 13) bgraybr Slackware 3 04-01-2010 06:57 PM
runlevels 7-9? jimmy page Linux - General 5 01-08-2010 08:46 PM
I Don't Understand RunLevels anon209 Linux - General 7 03-18-2006 07:20 AM
runlevels? Computergirl24 Linux - Software 4 12-26-2003 04:45 PM
runlevels kriver Linux - General 1 03-13-2002 05:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 01:12 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
Open Source Consulting | Domain Registration