When studying about Linux runlevels I came across something I was unable to explain to myself while trying to change the DEFAULT_RUNLEVEL.
When I boot Mint, it starts in runlevel 5, even though it clearly states that the DEFAULT_RUNLEVEL is 2.
In Linux Mint 18.3 there is no more /etc/inittab by default. Thus, the DEFAULT_RUNLEVEL config comes from /etc/init/rc-sysinit.conf.
This file has a few references to DEFAULT_RUNLEVEL or RUNLEVEL, as can be seen in the below extract from it:
# Default runlevel, this may be overriden on the kernel command-line
# or by faking an old /etc/inittab entry
env DEFAULT_RUNLEVEL=2
Yet, there is no /etc/inittab. Therefore, I keep reading the rc-sysinit.conf file:
for ARG in $(cat /proc/cmdline)
do
case "${ARG}" in
-b|emergency)
# Emergency shell
[ -n "${FROM_SINGLE_USER_MODE}" ] || sulogin
;;
[0123456sS])
# Override runlevel
DEFAULT_RUNLEVEL="${ARG}"
;;
-s|single)
# Single user mode
[ -n "${FROM_SINGLE_USER_MODE}" ] || DEFAULT_RUNLEVEL=S
;;
esac
done
Even though this seems to be the solution to my question, taking a look at /proc/cmdline reveals that it does not fulfill case [0123456sS] because cat /proc/cmdline results in the following output:
BOOT_IMAGE=/boot/vmlinuz-4.10.0-38-generic root=UUID=03a422a0-4301-4153-8c60-1ea912ad732f ro quiet splash vt.handoff=7
Is there any other place that could overwrite the DEFAULT_RUNLEVEL?
ls -la /sbin/init
– jdwolf Jan 03 '18 at 06:38