home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!portal!cup.portal.com!compata
- From: compata@cup.portal.com (David H Close)
- Newsgroups: comp.unix.xenix.sco
- Subject: Keep-alive watchdog for shell process
- Message-ID: <64683@cup.portal.com>
- Date: Wed, 26 Aug 92 02:33:15 PDT
- Organization: The Portal System (TM)
- Distribution: world
- Lines: 24
-
- It may not be relevant but this system is SCO Xenix 386 2.3.3 with xnx296.
- My question relates to a fairly generic shell process, probably similar for
- all known flavors of Unix.
-
- Does anyone know of a way to make a shell process dependent upon the
- periodic receipt of a "keep-alive" signal? Of course, I mean through the
- use of the standard set of shell commands and system utilities. That is,
- without programming except in sh, is there a way to make a shell process
- die if it doesn't receive some signal at regular intervals?
-
- A first look at TFM reveals that alarm(S) has no counterpart in (C), at
- least that I can see. If wrapped in a simple C program, alarm() would
- still not work as that program would not run in the shell's process. So,
- I suspect that two cooperating but independent processes will be needed.
- The extra one would receive the periodic signals, resetting its own alarm
- each time. If one failed to arrive and the alarm was triggered, the main
- process would be signalled. But I can't see any way to write this extra
- process entirely in sh (or ksh for that matter).
-
- Of course, if there isn't a way, I'd also appreciate any pointers to a
- simple program that could do the job. Thanks for your consideration.
-
- Dave Close - Compata - Stockton, California - +1 209 467 8255 ("209-install")
- dave@compata.attmail.com | compata@mcimail.com | dhclose@alumni.caltech.edu
-