Control: tags -1 confirmed
Control: tags -1 patch
Control: reassign -1 runit 2.1.2-27
Control: affects -1 runit-init



On Tue, 06 Jul 2021 23:58:19 +0200
Carsten Leonhardt <l...@debian.org> wrote:

> Package: runit-init
> Version: 2.1.2-40
> Severity: important
> 
> Hi Lorenzo,
> 

Hi Carsten,

Thanks for reporting this bug

> running runit as PID 1, my habitual "shutdown -r now" doesn't work, it
> does nothing at all.

This is actually worst than I initially thought, as making the -f flag
a noop is breaking the switch from sysvinit to runit (I will track the
switch issue, that is likely RC, in another bug).
Attached there is a minimalistic patch that should fix the problem: I
made some testing of the basic usage with runit-init and the init
switch.

> This also prevents acpi-support-base from handling the pressing of the
> power button to shutdown, the package calls
> 
> /sbin/shutdown -h -P now "Power button pressed"
> 
> (see /etc/acpi/powerbtn-acpi-support.sh)
> 
> In extension, that prevents libvirt to shutdown/reboot a VM running
> with runit-init ("virsh shutdown <vm>").

I didn't have the time and the knowledge to test with libvirt. I know
that switching init can be time consuming and setup disruptive, but it
would be great if you can confirm that the attached patch fix the issue
for your usecase.

Regards,
Lorenzo

to build from git/salsa
https://salsa.debian.org/Lorenzo.ru.g-guest/runit/-/tree/2.1.2-41exp

only the patch for shutdown.c

--- ./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;
        }
 }
 

Reply via email to