From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/2858 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Jeff Newsgroups: gmane.comp.sysutils.supervision.general Subject: Re: runit SIGPWR support Date: Fri, 14 Feb 2020 11:08:28 +0100 Message-ID: <6985131581674908@sas1-5ec0e8206abb.qloud-c.yandex.net> References: <1beb6e35-d4be-60b8-fc52-af666c4fffe3@gmx.com> <20200212215427.GG12551@cathexis.xen.prgmr.com> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="123377"; mail-complaints-to="usenet@ciao.gmane.io" To: supervision Original-X-From: supervision-return-2447-gcsg-supervision=m.gmane-mx.org@list.skarnet.org Fri Feb 14 11:08:32 2020 Return-path: Envelope-to: gcsg-supervision@m.gmane-mx.org Original-Received: from alyss.skarnet.org ([95.142.172.232]) by ciao.gmane.io with smtp (Exim 4.92) (envelope-from ) id 1j2Xtf-000VyO-R2 for gcsg-supervision@m.gmane-mx.org; Fri, 14 Feb 2020 11:08:31 +0100 Original-Received: (qmail 8913 invoked by uid 89); 14 Feb 2020 10:08:57 -0000 Mailing-List: contact supervision-help@list.skarnet.org; run by ezmlm Original-Sender: Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Original-Received: (qmail 8906 invoked from network); 14 Feb 2020 10:08:57 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.com; s=mail; t=1581674908; bh=Klg/giONiR2OMIv/kZu41JWdDsRrsSQnXpXzEYmEMLo=; h=References:Date:Message-Id:Subject:In-Reply-To:To:From; b=rGSG5tAgLsMDsPzmIoqDaEbda9+ERUKUPJtPP5YsgDxGieReyqMGRPiv08xnW11Kw Fuf7d2+yQqJGLfuVjyu7hCibQ27nkKF6VmpYyngUx+ccfP09+YWJrcRKvv+GpSZTtx 0jC/3y/VPOrOpqGGKCBzUajzNiJ6RW9sCeqHq0QA= Authentication-Results: mxback8o.mail.yandex.net; dkim=pass header.i=@yandex.com In-Reply-To: <20200212215427.GG12551@cathexis.xen.prgmr.com> X-Mailer: Yamail [ http://yandex.ru ] 5.0 Xref: news.gmane.io gmane.comp.sysutils.supervision.general:2858 Archived-At: 12.02.2020, 22:54, "Colin Booth" : > I wasn't trying to be hostile, apologies if it came across that way. As > far as I know SIGPWR is a Linux-specific signal so services that are this is a SysV signal that is sent in case of power suply problems. it has no special meaning per se and can be (ab)used for everything the coder sees fit. is the abuse of SIGTSP in BSD init "POSIX-compliant" or even necessary ? certainly not. > aiming for portability will either need to have special handling for > that in the linux case or need to ignore it. Ergo, runit (and all other > POSIX-compliant inits) currently have no special handling around SIGPWR > as they don't understand what it is. what is a "POSIX-compliant init" btw ? > Is this the right behavior? I don't know. yes. what should power suply problems mean to container ? > Something like SIGPWR as an > alerting mechanism when you're switched to UPS battery is pretty nice in > a general case but using that as your container shutdown solution > isolates you into a very SysV-specific world. BS. Linux provides this signal so you can (ab)use it for anything you wish. > Overriding the default via > lxc.signal.halt will allow you to modify what you send to something that > is within the POSIX spec and allow you to trigger shutdowns the "right" > way. It's a little lame but it is portable, and LXC using a non-portable > signal is a little bit of a bummer. why "fix" LXC when adding handler code for SIGPWR to runit is not much of a deal: #ifdef SIGPWR /* handle it analogous to SIGTERM or else */ #endif this is also very portable to systems that do not provide SIGPWR. not in any way, the signal is portable between Linux and SysV unices. it is a good idea to use it since it is rarely used for anything, another solution could be usage of real time signals.