From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.sysutils.supervision.general/837 Path: news.gmane.org!not-for-mail From: B S Srinidhi Newsgroups: gmane.comp.sysutils.supervision.general Subject: Querying service status :: A suggestion Date: Tue, 09 Aug 2005 17:53:57 +0530 Organization: DeepRoot Linux Pvt. Ltd. Message-ID: <1123590237.3174.72.camel@srinidhi.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1123590572 18968 80.91.229.2 (9 Aug 2005 12:29:32 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 9 Aug 2005 12:29:32 +0000 (UTC) Original-X-From: supervision-return-1073-gcsg-supervision=m.gmane.org@list.skarnet.org Tue Aug 09 14:29:30 2005 Return-path: Original-Received: from antah.skarnet.org ([212.85.147.14]) by ciao.gmane.org with smtp (Exim 4.43) id 1E2TDE-00069i-2S for gcsg-supervision@gmane.org; Tue, 09 Aug 2005 14:28:08 +0200 Original-Received: (qmail 11401 invoked by uid 76); 9 Aug 2005 12:28:28 -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 11395 invoked from network); 9 Aug 2005 12:28:28 -0000 X-Spam-Status: No, hits=-2.7 required=4.0 X-Spam-Report: SA TESTS -2.8 ALL_TRUSTED Passed through trusted hosts only via SMTP 0.1 TW_VC BODY: Odd Letter Triples with VC X-deepOfix-Mail-Filter-Mail-From: srinidhi@deeproot.co.in via anubhav X-deepOfix-Mail-Filter: 1.25st (Clear:RC:0(192.168.1.15):SA:0(-2.7/4.0):. Processed in 4.747732 secs Process 7157) Original-To: supervision@list.skarnet.org X-Mailer: Evolution 2.2.2 Xref: news.gmane.org gmane.comp.sysutils.supervision.general:837 X-Report-Spam: http://spam.gmane.org/gmane.comp.sysutils.supervision.general:837 Hello list, I'm new to this list but not to runit. :) I'm writing a small utility to show the status of the services being supervised. One of the main challenges (for me) was to find the time the service spent in the current state. e.g., how long a service has been down, etc. I checked runit's sources to get a clue, but wasn't able to (confidently) implement anything. (I'm not very comfortable with tai64n) :( I observed something in the behavior of runsvctrl and friends, but I'm not sure. Whenever a service is sent a signal, the supervise/status file is regenerated. (???) In other words, its creation time stamp gets changed. So I thought that a simple stat() of supervise/status file could give me the creation time and then a simple difftime() against the current time(NULL) could give the last change status. Is this approach *sane*??? :) If not, then could someone please explain the correct procedure? Srinidhi. -- B S Srinidhi DeepRoot Linux Pvt. Ltd.