From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/867 Path: news.gmane.org!not-for-mail From: Charles Duffy Newsgroups: gmane.comp.sysutils.supervision.general Subject: Re: runit - access to run script's exit status for finish? Date: Mon, 12 Sep 2005 10:11:58 -0500 Message-ID: References: <20050529055250.21848.qmail@eea771e6cc397c.315fe32.mid.smarden.org> <20050530074233.GA17439@skarnet.org> <20050531114539.16382.qmail@6607a8c5b39a0b.315fe32.mid.smarden.org> <20050531190911.25938.qmail@adf4e649eec508.315fe32.mid.smarden.org> <20050601000521.GB32490@grummit.biaix.org> <20050827192438.24239.qmail@573d30f8a31845.315fe32.mid.smarden.org> <20050829080807.24479.qmail@b57f7a37a4464e.315fe32.mid.smarden.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1126538357 16766 80.91.229.2 (12 Sep 2005 15:19:17 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 12 Sep 2005 15:19:17 +0000 (UTC) Original-X-From: supervision-return-1103-gcsg-supervision=m.gmane.org@list.skarnet.org Mon Sep 12 17:19:09 2005 Return-path: Original-Received: from antah.skarnet.org ([212.85.147.14]) by ciao.gmane.org with smtp (Exim 4.43) id 1EEq3J-0003Yn-KT for gcsg-supervision@gmane.org; Mon, 12 Sep 2005 17:17:02 +0200 Original-Received: (qmail 2081 invoked by uid 76); 12 Sep 2005 15:17:22 -0000 Mailing-List: contact supervision-help@list.skarnet.org; run by ezmlm List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Archive: Original-Received: (qmail 2075 invoked from network); 12 Sep 2005 15:17:22 -0000 X-Injected-Via-Gmane: http://gmane.org/ Original-To: supervision@list.skarnet.org Original-Lines: 32 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: fwext1-ext.isgenesis.com User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050716) X-Accept-Language: en-us, en In-Reply-To: <20050829080807.24479.qmail@b57f7a37a4464e.315fe32.mid.smarden.org> Original-Sender: news Xref: news.gmane.org gmane.comp.sysutils.supervision.general:867 Archived-At: Gerrit Pape wrote: > This sounds like a very good idea. I didn't re-check, but it should be > possible to extend the supervise/status file by two bytes, being the > last return code from ./run and ./finish, initially 0, without breaking > backward compatibility. From what I've seen from the code so far, I agree that there shouldn't be backwards-compatibility issues. However, on actually attempting to implement the interface we discussed, I've found it to be somewhat inadequate: It permits the user to retrieve the last exit status, but does *not* have any way to track there has been any exit at all within this run, nor whether the program terminated via a signal without calling exit() [and thus without setting an exit status]. I'm considering extending by sizeof(int)*2 and storing wait()'s output verbatim; that way, WIFEXITED/WIFSIGNALED/WTERMSIG/WEXITSTATUS are all available, and it's possible to determine if the last exit was via a signal (and if so, what). This leaves open the question of how to expose this information to the user. I'm considering the following: -r: last exit type and value for ./run -f: last exit type and value for ./finish could return instead of , :, as in "signal:11", "exit:0", "exit:1" or "none:0" (if there has, as of yet, been no exit). Thoughts?