The officially official Devuan Forum!

You are not logged in.

#1 2021-02-07 16:26:46

mweishaar
Member
Registered: 2018-11-11
Posts: 36  

Devuan runlevels

I am running beowulf with sysvinit, and just upgraded my video card from an Nvidia GTX 750 to an AMD Radeon R9 380.  Before undertaking this, I decided to make sure I remembered how to boot without X for if   when the need arose.  It has been at least 10 years since I had to do that, and a quick search on google (incorrectly) confirmed X was in runlevel 5 and I should boot into runlevel 3 for text-only mode.

Always test and verify!  After modifying a grub entry at boot time and appending runlevel 3, it still launched into X.  I checked my runlevel using who -r and confirmed I was in 3.  Ok, so I had to do more research, and dig into grub and runlevels.  This is where I discovered that all my old dusty knowledge didn't apply anymore.  Default runlevel is 2, not 5.  And it wouldn't matter if I changed it to 5, because all runlevels 2-5 in /etc/rc#.d were identical.  I eventually modified runlevel 3 to boot without X by disabling slim  sudo update-rc.d slim disable 3, then created a custom boot entry for runlevel 3 in /etc/grub.d/40_custom and added it to grub with sudo update-grub.  Works as expected, no X.

This post is mainly for posterity.  Even though I've been using linux for 20+ years I learned something, including that you don't need an xorg.conf file anymore. 

Out of curiosity, when were runlevels 2-5 made the same?  Was it in Debian pre-systemd or is it a Devuan thing?

Offline

#2 2021-02-07 16:48:50

Head_on_a_Stick
Member
From: London
Registered: 2019-03-24
Posts: 3,125  
Website

Re: Devuan runlevels

mweishaar wrote:

when were runlevels 2-5 made the same?

AFAIK runlevels 2-5 have always been the same in Debian but I've only been using it since wheezy so I might be wrong.

Reference: https://wiki.debian.org/RunLevel

But note that in Debian under systemd runlevels 2,3 & 4 are simulated as multi-user.target (which is a console-only boot) whereas runlevel 5 is simulated as graphical.target (which is a graphical boot):

$ ls -l /lib/systemd/system/runlevel?.target 
lrwxrwxrwx 1 root root 15 Jan 29 14:16 /lib/systemd/system/runlevel0.target -> poweroff.target
lrwxrwxrwx 1 root root 13 Jan 29 14:16 /lib/systemd/system/runlevel1.target -> rescue.target
lrwxrwxrwx 1 root root 17 Jan 29 14:16 /lib/systemd/system/runlevel2.target -> multi-user.target
lrwxrwxrwx 1 root root 17 Jan 29 14:16 /lib/systemd/system/runlevel3.target -> multi-user.target
lrwxrwxrwx 1 root root 17 Jan 29 14:16 /lib/systemd/system/runlevel4.target -> multi-user.target
lrwxrwxrwx 1 root root 16 Jan 29 14:16 /lib/systemd/system/runlevel5.target -> graphical.target
lrwxrwxrwx 1 root root 13 Jan 29 14:16 /lib/systemd/system/runlevel6.target -> reboot.target
$

Brianna Ghey — Rest In Power

Offline

#3 2021-02-07 17:25:34

mweishaar
Member
Registered: 2018-11-11
Posts: 36  

Re: Devuan runlevels

Head_on_a_Stick wrote:
mweishaar wrote:

when were runlevels 2-5 made the same?

AFAIK runlevels 2-5 have always been the same in Debian but I've only been using it since wheezy so I might be wrong.

Reference: https://wiki.debian.org/RunLevel

But note that in Debian under systemd runlevels 2,3 & 4 are simulated as multi-user.target (which is a console-only boot) whereas runlevel 5 is simulated as graphical.target (which is a graphical boot):

$ ls -l /lib/systemd/system/runlevel?.target 
lrwxrwxrwx 1 root root 15 Jan 29 14:16 /lib/systemd/system/runlevel0.target -> poweroff.target
lrwxrwxrwx 1 root root 13 Jan 29 14:16 /lib/systemd/system/runlevel1.target -> rescue.target
lrwxrwxrwx 1 root root 17 Jan 29 14:16 /lib/systemd/system/runlevel2.target -> multi-user.target
lrwxrwxrwx 1 root root 17 Jan 29 14:16 /lib/systemd/system/runlevel3.target -> multi-user.target
lrwxrwxrwx 1 root root 17 Jan 29 14:16 /lib/systemd/system/runlevel4.target -> multi-user.target
lrwxrwxrwx 1 root root 16 Jan 29 14:16 /lib/systemd/system/runlevel5.target -> graphical.target
lrwxrwxrwx 1 root root 13 Jan 29 14:16 /lib/systemd/system/runlevel6.target -> reboot.target
$

Thanks.  I started with Redhat in '98, then Mandrake in '02, and have been on Debian-based distros since '05 with Kubuntu/Xubuntu/Mint.  I've only been on Devuan since 2018.

I don't speak systemd - at least not yet.  tongue

Offline

Board footer