Re: Possible to shut down an s6 service via command rather than signal?

From: Carlos Eduardo <carana2099_at_gmail.com>
Date: Wed, 24 Jul 2024 15:15:15 -0300

From a similar Github issue [1], the suggested way of implementing "stop
commands" on top of s6 is running these two commands:

```
s6-svc -O /path/to/service
stop-command
```

I'm not aware of any s6-rc sugar around it.

[1] https://github.com/skarnet/s6/issues/18#issuecomment-693368046

Em qua., 24 de jul. de 2024 14:30, Brett Neumeier via supervision <
supervision_at_list.skarnet.org> escreveu:

> I'm trying to set up supervision for a QEMU virtual machine on a machine
> that uses s6 and s6-rc for service management. I can certainly stop the VM
> process by sending it a signal -- it appears that SIGINT, SIGTERM, and
> SIGPWR all work for this -- but none of those trigger a graceful shutdown
> of the operating system running in the VM, they just cause QEMU to
> terminate.
>
> I can tell QEMU to send an ACPI poweroff request to the VM by sending a
> "system_powerdown" command to the QEMU monitor; the way I have this
> currently set up, I can do that by simply running a command like:
>
> echo system_powerdown | monitor.in
>
> I'm wondering, is there a reasonably idiomatic way to do this with s6 or
> s6-rc? Or should I do something like write a wrapper script that catches
> SIGTERM and converts that into a system_powerdown command like the above?
> Or is there some other, less kludgy, alternative?
>
> (I'm also pondering patching my QEMU so that I can have it run the same
> ACPI shutdown routine when it catches a signal, which would be a way of
> making it play nicely with standard s6 idioms, but I'd *rather* not have to
> do that.)
>
> Cheers!
>
>
> --
> Brett Neumeier <random_at_freesa.org>
>
Received on Wed Jul 24 2024 - 20:15:15 CEST

This archive was generated by hypermail 2.4.0 : Wed Jul 24 2024 - 20:15:39 CEST