Monitoring your nameserver

Boyd Roberts boyd at necisa.ho.necisa.oz
Mon Aug 20 14:37:35 AEST 1990


In article <7769 at gollum.twg.com> david at twg.com (David S. Herron) writes:
>
>This process will somehow take a list of processes to watch after.
>It will be the parent of all those processes, so that it will be notified
>of them dieing ..  It will have a number of actions it can do when
>the process dies, like wait awhile before starting a new copy, start
>one immediately, start one under some condition, etc.
>

It's been done already.  Back in '83 or so Tim Long% at Sydney Uni
Comp Sci rewrote init so it was far more flexible as a general
purpose daemon controller.

He had a file /etc/procs with entries like this:

tty-console	/etc/login@ peb1200 /dev/console
netd-basser40	/usr/spool/ACSnet/_lib/NNdaemon -I basser40
skulk		/etc/skulk

The first field was a handle for the process and the other fields
were the program to run and its arguments.  All daemons were started
by init and a naming convention was used so that a group of related
processes could be controlled easily.

There was no concept of init `state'.  But you could interrogate
init and ask it what was going on.  To interrogate it you used
a program called `toinit':

    toinit <command> <regular-expressions...>

The commands were (from what I can remember):

    start	- start it
    stop	- SIGTERM it and don't restart it
    kill	- SIGTERM then SIGKILL
    curtail	- don't restart it when it dies
    status	- tell me what the state of world is
    scanprocs	- re-read /etc/procs and incorporate any changes

The regular expressions were matched against the first /etc/procs field
(the handle for the process) and the appropriate action was taken
on any of the matches.

There were special entries in /etc/procs for a single user shell on the
console for boot & shutdown.  Startup was just a script that had the
appropriate mounts and then a large `toinit start ...'.  Shutdown
was just a `toinit stop tty-.* ...' and then some magic (I forget)
to get a single user shell on the console (these machines were 32V
VAX 11/780's).

There were some bugs, but we fixed them and hacked in some more
magic for auto-reboots.  The `magic' was usually just a `rc' like
script that did the right things and then told init to start
the appropriate stuff.

With this approach you could control a _single_ entry, unlike the
ghastly mess that is System V's /etc/inittab.  The IPC between
`toinit' and `init' was a bit messy, but with a mounted process
stream implementation (was this ever done John?) it can be
done really cleanly.


Boyd Roberts			boyd at necisa.ho.necisa.oz.au

``When the going gets wierd, the weird turn pro...''

-------
% Bruce Ellis, Piers Lauder, John Mackin, Chris Maltby and myself
  added mods and bug fixes over the years.

@ getty/login were re-written into /etc/login.  /bin/login was unlinked.



More information about the Comp.unix.wizards mailing list