Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#990019: initscripts: single user mode broken with newer versions of systemd

33 views
Skip to first unread message

Ximin Luo

unread,
Jun 17, 2021, 6:30:04 PM6/17/21
to
Package: initscripts
Version: 2.96-7
Severity: important
Tags: patch

Dear Maintainer,

Single-user mode is broken with newer versions of systemd which do not support the -t option:

$ /sbin/init -t1
/sbin/init: invalid option -- 't'
exit code 1

This however is still used in /etc/init.d/single:

exec init -t1 S

This breaks single user mode with the following error:

systemd[1]: Failed to start LSB : executed by init(8) upon entering runlevel 1 (single)..

This problem was also reported in https://forum.odroid.com/viewtopic.php?f=184&t=42211

The problem is fixed if we drop the -t1 from /etc/init.d/single

X

-- System Information:
Debian Release: 11.0
APT prefers testing
APT policy: (990, 'testing'), (500, 'unstable-debug'), (500, 'testing-security'), (500, 'testing-debug'), (500, 'stable'), (300, 'unstable'), (100, 'experimental'), (1, 'experimental-debug')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.9.0-4-amd64 (SMP w/4 CPU threads)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE=en_GB:en
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages initscripts depends on:
ii lsb-base 11.1.0
ii sysv-rc 2.96-7

Versions of packages initscripts recommends:
ii e2fsprogs 1.46.2-1
ii psmisc 23.4-2

initscripts suggests no packages.

-- no debconf information

Jesse Smith

unread,
Jun 18, 2021, 9:10:03 AM6/18/21
to
I was a little confused by the subject of this bug since this has
nothing to do with systemd. Neither the script nor the init call has any
connection to systemd.

The issue here is that the init script (/etc/init.d/single) is trying to
call SysV init with the "-t1" flag, which is not valid. There is no -t
flag or -t1 flag for init.

I suspect what the script was intended to do is call "/sbin/telinit -t 1
s". This would switch to single user mode after a delay of just one second.

- Jesse

Mark Hindley

unread,
Sep 11, 2021, 6:10:04 AM9/11/21
to
On Fri, Jun 18, 2021 at 09:55:42AM -0300, Jesse Smith wrote:
> The issue here is that the init script (/etc/init.d/single) is trying to
> call SysV init with the "-t1" flag, which is not valid. There is no -t
> flag or -t1 flag for init.
>
> I suspect what the script was intended to do is call "/sbin/telinit -t 1
> s". This would switch to single user mode after a delay of just one second.

I can't see any indication of the original intention for using the -t1 flag. It
has been that way since commit 9184ce235175aeae2725650d34af2c1486b6a73c made in
2005!

The systemd version of telinit doesn't appear to support the -t option[1],
although I think systemd masks single.service to avoid using
/etc/init.d/single. But, I suppose a user could circumvent that.

The most compatible way to deal with this is probably just to remove the -t1
option completely.

Mark

[1] https://manpages.debian.org/stretch/systemd-sysv/telinit.8.en.html
0 new messages