From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/2507 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: "John O'Meara" Newsgroups: gmane.comp.sysutils.supervision.general Subject: Re: Generic interrupt command? Date: Sat, 9 Feb 2019 23:14:20 -0500 Message-ID: References: <20190201213620.68abc837@mydesk.domain.cxm> <20190202143014.77a5ac5f@mydesk.domain.cxm> <20190202210810.qckhzw4zgfxui6u3@cathexis.xen.prgmr.com> <20190202164042.20551e42@mydesk.domain.cxm> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000e4e17c0581826d33" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="221973"; mail-complaints-to="usenet@blaine.gmane.org" Cc: supervision@list.skarnet.org To: Laurent Bercot Original-X-From: supervision-return-2097-gcsg-supervision=m.gmane.org@list.skarnet.org Sun Feb 10 05:14:39 2019 Return-path: Envelope-to: gcsg-supervision@m.gmane.org Original-Received: from alyss.skarnet.org ([95.142.172.232]) by blaine.gmane.org with smtp (Exim 4.89) (envelope-from ) id 1gsgVq-000vU5-T1 for gcsg-supervision@m.gmane.org; Sun, 10 Feb 2019 05:14:38 +0100 Original-Received: (qmail 27953 invoked by uid 89); 10 Feb 2019 04:15:01 -0000 Mailing-List: contact supervision-help@list.skarnet.org; run by ezmlm Original-Sender: Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 27945 invoked from network); 10 Feb 2019 04:15:00 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Fxe/11L6ecf1qbj+KyiF6HrhMTOIwa7SIXGZkMxVw0I=; b=lrlbH6DN7eEEuktM38BSiYNcCb5QiQ8tIqm42agqtVJa/FIXks4R8RlNFXr3R6jkQz 5nWy0eeWE+rIukXYRT5RA6yZzbirya9qoCdNVoP38yGplmReHjdiGi/DiK50IbxbChJG Rn5Pxpamzdh+qY5oipz4kEen+oeyB57vB2+UiUvHoFKIzaRnTcWQjQbGAv8pTcXMmQPG RGHaUu4vv2bARxeGS1k0HAhHGdJ8oTVB185cHwAVSSKjib4Hlq5l3xjgGrh1BOvMQnSH 9z/BFdIpx2xY2nKuVLMA39HMHJqjlT8cFmpK06B9AeqFrjALrG6umL+LsJZZKhZ645ms IDUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Fxe/11L6ecf1qbj+KyiF6HrhMTOIwa7SIXGZkMxVw0I=; b=afsjEVNC8JNuCmUSSUcAtIU852S7EomH0/Y/k5vp75FkN5MmtcK7ecHNDeNQ++Au4m NTnR/OE6Wxeu4Vc4OvwJiiWsk/5HDzmm1NyRztq8H/9xYuBvgwTR0bf3r3VHGdiFucvN YygWbgFSL8lpc33ZQMl1TXm3UatjlN6j/RNECK8Vp7o7PDCB1iBSkfRyt+YnTtNgVWP2 bC+q3bSQbiLm79lw7AGQ6Q0KzyqIByoJBVxZjB1IaovUzLYcuoFMaO7ScCPRoi03VE19 ryE7tTwn1NRW4H8UMgu/14YkGyE6PVccQ7fqg+kusc/MX6Vk/eBASkLejU1J0R1wISeK KmjA== X-Gm-Message-State: AHQUAuZyLOEcVVqLWq91W8eIsZaPihIQbajDs2apNoYQcQlX9mQC3Upx a/7LYZpUu7w3pYeCOb/JAxyEvIYQzAIbWretKTM= X-Google-Smtp-Source: AHgI3IZSl2vWffGXaCb2fwKFzFsWO61W0eq9KWSjGBB0F1zG+zA6DkQHsATiAVN0SD1/0SFbyuOWcSZAO5bxzDU6sPA= X-Received: by 2002:a5d:8d18:: with SMTP id p24mr5348127ioj.223.1549772072999; Sat, 09 Feb 2019 20:14:32 -0800 (PST) In-Reply-To: Xref: news.gmane.org gmane.comp.sysutils.supervision.general:2507 Archived-At: --000000000000e4e17c0581826d33 Content-Type: text/plain; charset="UTF-8" On Tue, Feb 5, 2019, 2:30 PM Laurent Bercot >Not outputting anything causes kill (on my system at least) to exit non > >0 > > Not outputting anything isn't an option, for the case where -o pid is > used in addition to other fields. The field number and order must be > respected. > Agreed; I didn't mean to suggest that as an option, I just wanted to be thorough with testing. It's probably best to use some OOB indicator. How about NA, which I > already use for non-numeric fields? it makes kill correctly choke. > Would it be better to use NA in all the numeric fields, too? > That's a tough call. On the one hand, it makes simple constructs safer. On the other, it adds complexity to interpreting the data programmatically ( the test / [ program errors for integer comparisons with text, and using scanf() to pull in the values for libc style programs wouldn't be so simple anymore). Maybe adding a flag like -n as an output modifier to keep the relevant output numeric when wanted? Then the default could be NA. Of course, that adds complexity to the svstat program, it's interface and documentation. It is also incompatible with existing programs that may be using svstat already, requiring the flag for new versions of svstat and not the flag for old versions. Also, while thinking about this, I wonder the risk of signaling the wrong program. When svc does it via supervise, it can know the right program gets the signal because it handles the cleaning of the child PID. In a script, there is a chance the child has exited and been replaced between the time the PID was queried by svstat and the time the kill command gets executed. I don't know how likely a new program might get the old PID in that time, this receiving the signal intended for the original child. I think itis a low number, but not zero. This line of thinking unfortunately brings us back to the original post in this thread :-( -- John O'Meara > --000000000000e4e17c0581826d33--