Package: runit
Version: 2.1.2-40
Severity: important
Tags: patch
X-Debbugs-Cc: plore...@disroot.org

The fix for #919699 introduced a regression described in #990774: when shutdown,
halt or reboot is called with parameters it does nothing. This includes the -f 
flag.
A consequence is that the switch  Sysvinit --> runit-init can be broken.
When plain shutdown or reboot are called (for instance by a graphical desktop 
env),
SysVinit is told to enter runlevel 0 or 6, but then it expects halt -f or 
reboot -f
 to finish the job (but they are noop, so the system is left in a wierd state).

When reboot is called the system initate the shutdown process, then stops and
the user can login into emergency shell: from there, only if the user call 
again reboot,
the system will complete the shutdown process (after about 15 seconds of 
waiting).

If shutdown is called the system initate the shutdown process but then stops: 
all
tty's are down, no way to login, and init does not complete the shutdown. From 
there
one can only press the reset button.

Runit-init users are not affected only because, when stage3 returns (because 
halt -f is a noop)
runit uses it's own internal code to poweroff or reboot.
The switch from systemd is not affected because systemd uses it's own internal 
code
to perform the shutdown.

I've already tested that the patch for #990774, attached below,
fix this issue too

patch: (the last two lines with the -r flag are not strictly needed here )

--- ./shutdown.c        2020-01-13 01:07:09.185373016 +0100
+++ ./shutdown-new.c    2021-07-15 14:51:04.482088733 +0200
@@ -134,14 +134,16 @@
        }
 
        for (i = 1; i != argc; ++i) {
-               if (strcmp(argv[i], "-f"))
+               if (strcmp(argv[i], "-f") == 0)
                        cfg->force = true;
-               if (strcmp(argv[i], "--force"))
+               if (strcmp(argv[i], "--force") == 0)
                        cfg->force = true;
-               if (strcmp(argv[i], "-w"))
+               if (strcmp(argv[i], "-w") == 0)
                        cfg->wtmp_only = true;
-               if (strcmp(argv[i], "--wtmp-only"))
+               if (strcmp(argv[i], "--wtmp-only") == 0)
                        cfg->wtmp_only = true;
+               if (strcmp(argv[i], "-r") == 0)
+                       cfg->action = ACTION_REBOOT;
        }
 }
 

-- System Information:
Debian Release: 11.0
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 5.7.0-1-amd64 (SMP w/4 CPU threads)
Kernel taint flags: TAINT_FIRMWARE_WORKAROUND, TAINT_OOT_MODULE, 
TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US:en
Shell: /bin/sh linked to /bin/dash
Init: runit (via /run/runit.stopit)

Versions of packages runit depends on:
ii  libc6           2.31-12
ii  sysuser-helper  1.3.5.1

Versions of packages runit recommends:
ii  runit-init  2.1.2-41exp1

Versions of packages runit suggests:
ii  socklog  2.1.0+repack-4+b1

-- Configuration Files:
/etc/default/runit changed [not included]
/etc/runit/ctrlaltdel changed [not included]
/etc/runit/runsvdir/single/sulogin/run [Errno 2] No such file or directory: 
'/etc/runit/runsvdir/single/sulogin/run'

-- no debconf information

Reply via email to