home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / unix / xenix / sco / 2744 < prev    next >
Encoding:
Internet Message Format  |  1992-08-25  |  1.7 KB

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