supervision - discussion about system services, daemon supervision, init, runlevel management, and tools such as s6 and runit
 help / color / mirror / Atom feed
* Querying service status :: A suggestion
@ 2005-08-09 12:23 B S Srinidhi
  2005-08-09 15:14 ` Joël Riou
  0 siblings, 1 reply; 2+ messages in thread
From: B S Srinidhi @ 2005-08-09 12:23 UTC (permalink / 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.



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-08-09 15:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-09 12:23 Querying service status :: A suggestion B S Srinidhi
2005-08-09 15:14 ` Joël Riou

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).