Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!nrl-cmf!mailrus!tut.cis.ohio-state.edu!bloom-beacon!mit-eddie!killer!ssbn!bill
From: bill@ssbn.WLK.COM (Bill Kennedy)
Newsgroups: comp.unix.xenix
Subject: How to make a daemon
Message-ID: <194@ssbn.WLK.COM>
Date: 10 May 88 23:00:56 GMT
Distribution: na
Organization: W.L. Kennedy Jr. & Associates, Pipe Creek, TX
Lines: 27
Keywords: init respawn

I am in a bit of a quandry and it appears that the net is going to be
able to respond before SCO will, so here's my m'aidez -

I need to respawn a process like a getty so that's there's nearly always
a copy active.  In straight ahead System V (I have SCO Vr2.2.3 80386) I
just put an entry in /etc/inittab that says

30:23:respawn:/usr/lib/clubs/omron ttym07

And init will spawn one, catch the death of a child signal and spawn
another one, I do that all the time.  It appears that the SCO Xenix
/etc/inittab is just a pacifier for those of who live and die by telinit,
you can spawn anything you want as long as it's /etc/getty.

I have written a routine into the program named "phoenix()" which does a
while ( fork() ), but it has all of the nasty features of such stuff,
leaves zombies wandering around and copies with a priority so low that I
have to reboot (and fsck grrr!) to be rid of them when something burps.
Plain old System V will close the tty if I fail to do so (giving a DTR
cycle to the modem) and I get a bright shiny fresh copy of the process to
take over when the predecessor dies.  While phoenix() works, it's ugly.
Can anyone suggest something a little closer to what I thought I could do?

I joked to my SCO sales rep today that if it wasn't for this group, they'd
be three weeks behind instead of just three days.  Thanks,
-- 
Bill Kennedy  usenet      {rutgers,ihnp4!killer,cbosgd}!ssbn!bill
              internet    bill@ssbn.WLK.COM