supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
From: "Brett Neumeier via supervision" <supervision@list.skarnet.org>
To: supervision@list.skarnet.org
Subject: Possible to shut down an s6 service via command rather than signal?
Date: Wed, 24 Jul 2024 12:30:27 -0500	[thread overview]
Message-ID: <20240724123027.8c04a742f5ee892725c2120f@freesa.org> (raw)

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>

             reply	other threads:[~2024-07-24 17:30 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-24 17:30 Brett Neumeier via supervision [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240724123027.8c04a742f5ee892725c2120f@freesa.org \
    --to=supervision@list.skarnet.org \
    --cc=random@freesa.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).