supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
From: B S Srinidhi <srinidhi@deeproot.co.in>
Subject: Querying service status :: A suggestion
Date: Tue, 09 Aug 2005 17:53:57 +0530	[thread overview]
Message-ID: <1123590237.3174.72.camel@srinidhi.com> (raw)

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 <srinidhi@deeproot.co.in>
DeepRoot Linux Pvt. Ltd.



             reply	other threads:[~2005-08-09 12:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-09 12:23 B S Srinidhi [this message]
2005-08-09 15:14 ` Joël Riou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1123590237.3174.72.camel@srinidhi.com \
    --to=srinidhi@deeproot.co.in \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).