supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
From: Carlos Eduardo <carana2099@gmail.com>
To: Brett Neumeier <random@freesa.org>
Cc: supervision <supervision@list.skarnet.org>
Subject: Re: Possible to shut down an s6 service via command rather than signal?
Date: Wed, 24 Jul 2024 15:15:15 -0300	[thread overview]
Message-ID: <CAN09KnJRt36sc_BCw62u9wmUWr5jiDZLA9Fsm7xW++BqKB10hw@mail.gmail.com> (raw)
In-Reply-To: <20240724123027.8c04a742f5ee892725c2120f@freesa.org>

[-- Attachment #1: Type: text/plain, Size: 1615 bytes --]

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

  reply	other threads:[~2024-07-24 18:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-24 17:30 Brett Neumeier via supervision
2024-07-24 18:15 ` Carlos Eduardo [this message]
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=CAN09KnJRt36sc_BCw62u9wmUWr5jiDZLA9Fsm7xW++BqKB10hw@mail.gmail.com \
    --to=carana2099@gmail.com \
    --cc=random@freesa.org \
    --cc=supervision@list.skarnet.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).