Date: Fri, 23 May 1997 14:34:04 +0100 (BST) From: Mr M P Searle <csubl@csv.warwick.ac.uk> To: danny@panda.hilink.com.au (Daniel O'Callaghan) Cc: syssgm@dtir.qld.gov.au, freebsd-hackers@freebsd.org Subject: Re: process monitoring tool (like SysV init)? Message-ID: <14239.199705231334@bourbon.csv.warwick.ac.uk> In-Reply-To: <Pine.BSF.3.91.970522161309.14689P-100000@panda.hilink.com.au> from Daniel O'Callaghan at "May 22, 97 04:18:58 pm"
next in thread | previous in thread | raw e-mail | index | archive | help
> > > On Thu, 22 May 1997, Stephen McKay wrote: > > > On Wednesday, 21st May 1997, J Wunsch wrote: > > > > >As Sakari Jalovaara wrote: > > > > > >> It struck me as a rather nice idea. No more "ps | grep sendmail ... > > >> kill ... sendmail -bd -q1h" - just do "nanny restart sendmail". > > > > > >All `conforming' daemons leave their PID in /var/run/<name>.pid. > > > > /var/run/* is good, but not foolproof. A daemon could die and not remove > > its pid file. An innocent bystander could be shot. A nanny program (assuming > > it doesn't die :-0 ) would know immediately if one of its children exited. > > > > I like the idea of a nanny type program, but can't decide whether it should > > be merged with init, much like System V, or kept separate like inetd. > > The question in my mind is "How does the nanny know that the program has > died?". If the program does not daemonise itself, then SIGCLD takes care > of that, but if the program *does* daemonise itself, what then? Would it > be possible for the kernel to signal an event such as a process dying? > Does it do this already? One simple, imperfect way is to grab a pid from > /var/run, and then watch /proc/{pid}/status. > It could use procfs, like killall does. (Does spawnd do this?) It would probably be slow though, so wouldn't want to run very often. It should find the daemon even if it is in the background and doesn't use /var/run, though. (AFAIK although the name can be changed, the original name is always kept.)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?14239.199705231334>