7

I have configured the lines in /etc/inittab as follows:

# The default runlevel.
id:2:initdefault:

But after logging in the output of runlevel is as follows:

N 5

So why am I in runlevel 5 instaed of 2?


Note: As an additionaly info here is uname -a output for my system

Linux d3bi4n 3.16.0-4-amd64 #1 SMP Debian 3.16.7-2 (2014-11-06) x86_64 GNU/Linux

and the output of dpkg -S /sbin/init is

systemd-sysv: /sbin/init
2
  • You are using SysVinit, right? What is the output of dpkg -S /sbin/init? Nov 29 '14 at 22:00
  • It's systemd-sysv: /sbin/init
    – Matthias
    Nov 30 '14 at 16:09
10
$ dpkg -S /sbin/init
systemd-sysv: /sbin/init

Your init system is Systemd, not SysVinit. /etc/inittab is a configuration file of SysVinit, it is not used by Systemd. I presume you have this file because this is a jessie system which was upgraded from an earlier jessie or from wheezy with SysVinit.

Systemd doesn't exactly have a concept of runlevels, though it approximates them for compatibility with SysVinit. Systemd has “target units” instead. You can choose the boot-time target unit by setting the symbolic link /etc/systemd/system/default.target. See the Systemd FAQ for more information.

If you don't want to use Systemd, install the sysvinit-core package, which provides a traditional SysVinit (formerly in the sysvinit package, which in jessie is now a front for systemd). As of jessie, Debian defaults to Systemd but still supports SysVinit.

1
  • Your figured it out. I upgraded from wheezy and was not aware of jessie using systemd. I switched back to sysvinit (for now) and it works fine. Thanks!
    – Matthias
    Dec 1 '14 at 16:10
1

You'll probably have runlevel 5 set in the kernel command line or arguments (look at your grub configuration):

You may override the default runlevel with kernel parameter. When the boot menu is displayed, select the edit option. Then locate the kernel line and append space and the desired runlevel number. E.g. "kernel /boot/vmlinuz-2.6.30 root=/dev/sda2 ro 3" would boot to runlevel 3. 

1

Source: https://unix.stackexchange.com/a/164028/120177 , http://www.freedesktop.org/software/systemd/man/systemctl.html

Open a terminal and (as root) run:

systemctl set-default multi-user.target

or with --force

systemctl set-default -f multi-user.target

to overwrite any existing conflicting symlinks1.

Double-check with:

systemctl get-default

Another way is to add the following parameter to your kernel boot line:

systemd.unit=multi-user.target
2
0

I looking how to run under Debian 8 similar like use with inittab system:

1:2345:respawn:/sbin/getty 38400 tty1

2:23:respawn:/sbin/getty 38400 tty2

3:23:respawn:/sbin/getty 38400 tty3

BPQ:2345:respawn:/home/bpq32/runbpq >/dev/tty4

where I have redirect output run program runbpq to /dev/tty4

but how to do this under Debian 8 with systemd ??

Best regards

-1

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

Default Debian installation does not make any difference between runlevels 2-5.

1
  • @matthias Your understanding is correct. By default, Debian configures exactly the same services to run in runlevels 2, 3, 4 and 5. Nonetheless, the runlevel number is tracked; the inittab line should make runlevel 2 the default. Nov 29 '14 at 21:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.