supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
* Possible to shut down an s6 service via command rather than signal?
@ 2024-07-24 17:30 Brett Neumeier via supervision
  2024-07-24 18:15 ` Carlos Eduardo
  2024-07-25  1:15 ` Dewayne Geraghty
  0 siblings, 2 replies; 8+ messages in thread
From: Brett Neumeier via supervision @ 2024-07-24 17:30 UTC (permalink / raw)
  To: supervision

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@freesa.org>

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-07-30 19:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-24 17:30 Possible to shut down an s6 service via command rather than signal? Brett Neumeier via supervision
2024-07-24 18:15 ` Carlos Eduardo
2024-07-24 21:09   ` Laurent Bercot
2024-07-25  1:15 ` Dewayne Geraghty
2024-07-25 16:26   ` Brett Neumeier via supervision
2024-07-25 16:56     ` Mario Rugiero
2024-07-29 17:29     ` Jan Braun
2024-07-30 19:33       ` Brett Neumeier via supervision

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).