From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI autolearn=ham autolearn_force=no version=3.4.4 Received: from alyss.skarnet.org (alyss.skarnet.org [95.142.172.232]) by inbox.vuxu.org (Postfix) with SMTP id D92742498F for ; Wed, 24 Jul 2024 19:30:37 +0200 (CEST) Received: (qmail 32139 invoked by uid 89); 24 Jul 2024 17:31:02 -0000 Mailing-List: contact supervision-help@list.skarnet.org; run by ezmlm Sender: Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Received: (qmail 32132 invoked from network); 24 Jul 2024 17:31:02 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freesa.org; s=20240612; t=1721842230; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=itZlrc+ojZQR4mLyCYkFqWr/CTh1FpxDwr017u5zEK8=; b=MufeCmbS/bKmlsAlaCU+g0pCQI5OAkTPv5LTEEu1o+G4+//jT3LIw2WLs6in2dQ3RY/6n4 S/NAXel1TYuz3C8w8HBHcT425j6OO4zrXStJtXBZhh6AHjU1enD3F4R8rM1xRG9u6l/qHG owDFc8fRWq587D6/YDm9dGJmbk08pjg= Date: Wed, 24 Jul 2024 12:30:27 -0500 From: "Brett Neumeier via supervision" Reply-To: Brett Neumeier To: supervision@list.skarnet.org Subject: Possible to shut down an s6 service via command rather than signal? Message-Id: <20240724123027.8c04a742f5ee892725c2120f@freesa.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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