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_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,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 0B88C2161F for ; Wed, 24 Jul 2024 20:15:11 +0200 (CEST) Received: (qmail 33562 invoked by uid 89); 24 Jul 2024 18:15:37 -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 33555 invoked from network); 24 Jul 2024 18:15:37 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721844909; x=1722449709; darn=list.skarnet.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=XZvfIBqy7csAAm2V7Gy11y8+UdLRAO45p3jrGy3geXg=; b=e7E5PuvZpkLti5sDp66v/e79h2LCV4RMt0P1aWS9HZDO8WSRQnXfcjhyhvn3xfKRrW UDyxwZat8FtV0NhAOuP3QTWLDE50APvgA7zzl9OfNKGsucvx/RjW0K3DVJaVDWAlhbp6 OzHXBnOJYbOwXHyO2Mn/XCDppms5B/D4/H9QtbVbz037boRu45+aAwwIMtJJNuDLz96S sX/UkD2YNEy1jx2XhcihH8Ic3tU0vX3oTBjUQf4yl4VVJcRN673jur8kpTV6E/mBwO62 02UVTiqiUdT1aesCgVJSv4/fZeBdLFtKPhWhwxg2Il/++TXDQu/cyb2nO19MbNFST7TD xVuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721844909; x=1722449709; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=XZvfIBqy7csAAm2V7Gy11y8+UdLRAO45p3jrGy3geXg=; b=w76g0zWgK7UMiD4yfxDyk4vz+I6HW/EjqPSUh2SkDLh//WMO+jQ+jhzjUvOD0BewG4 8GeYjvH6IZ+ZhUNB+hzML018312y1GBqRyaSCa//EttEDnrQk49Z+rOSrPdodzcJFlsQ d3fF6ajSzKPWR9cK/oqtNvVxnQyCV9H5MtoQYPxmoFmoEdcjb1UuiPNn9N6lpLILhJdu 5U0Gn8oCJvE2ACIIqMRZN7JNLRo8d3DqFuEJiTHe/1QN2m2CVnN/3Ttno9VJiZCbPslw iqDS3Irfc/iAS9j88uEseFxKGU8dolWnENQFxjVDmkJTi3gB5cLVXXunMjTndpFqjP01 PkbA== X-Gm-Message-State: AOJu0YzZENQ8XyPkd2dVF+GsHXdKh7kId3q8SAaGc3/c65rnJdJ5fXIv h7ZPFlsNgUbDfEbAUGeipJ2Elfm2nXBpZ+5NuWdyMpo3ly77JuDIIeYzC6AQ+OZND5FW48XdNDy xuYOIuqfSwbtz1lrzhNc/qnonlDI= X-Google-Smtp-Source: AGHT+IFxvWiNKLgKUWdSNx3rCoQ+NU0NUP1ZS8xqijFvnjZ6kUEf+1G7w+RnnHCmmzEtgf3WYKxWZwgp7q9m5XIhpKk= X-Received: by 2002:a05:6871:200f:b0:25e:24a0:4c96 with SMTP id 586e51a60fabf-264a0be21ebmr427999fac.11.1721844908788; Wed, 24 Jul 2024 11:15:08 -0700 (PDT) MIME-Version: 1.0 References: <20240724123027.8c04a742f5ee892725c2120f@freesa.org> In-Reply-To: <20240724123027.8c04a742f5ee892725c2120f@freesa.org> From: Carlos Eduardo Date: Wed, 24 Jul 2024 15:15:15 -0300 Message-ID: Subject: Re: Possible to shut down an s6 service via command rather than signal? To: Brett Neumeier Cc: supervision Content-Type: multipart/alternative; boundary="0000000000002595b0061e02422c" --0000000000002595b0061e02422c Content-Type: text/plain; charset="UTF-8" >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 > --0000000000002595b0061e02422c--