home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / unix / programm / 4344 < prev    next >
Encoding:
Text File  |  1992-08-17  |  1.5 KB  |  36 lines

  1. Newsgroups: comp.unix.programmer,comp.unix.
  2. Path: sparky!uunet!munnari.oz.au!mips!mips!darwin.sura.net!cs.ucf.edu!tarpit!fang!att!cbnewsk!ksc
  3. From: ksc@cbnewsk.cb.att.com (kenneth.s.cobler)
  4. Subject: Re: How to restart a process after the machine is up.
  5. Organization: AT&T
  6. Distribution: na
  7. Date: Mon, 17 Aug 1992 19:59:17 GMT
  8. Message-ID: <1992Aug17.195917.948@cbnewsk.cb.att.com>
  9. References: <Bt3yF9.JFI@usenet.ucs.indiana.edu>
  10. Lines: 24
  11.  
  12. In article <Bt3yF9.JFI@usenet.ucs.indiana.edu> jhu@bronze.ucs.indiana.edu (Jun Hu) writes:
  13. >Hi, Could someone help me with following question?
  14. >
  15.  [ deleted ]
  16.  
  17. >the machine will be down once every month, I would like to have my 
  18. >process terminated some way (save the core image of the process? ) 
  19. >before the machine is down and restarted manually from the point it 
  20. >stops after the machine is up, so the previous computing time is 
  21. >not wasted.
  22. >
  23.  
  24. A way to handle such a situation is to have your program write out
  25. all important data structures and values to a file then terminate
  26. itself upon receiving a signal (like SIGUSR1).  This allows your
  27. shutdown script to send a kill -16 to the PID of your program and
  28. it can gracefully exit with the current values of the various datum.
  29. During boot, your program can check for the file and quickly load
  30. all the values saved in the file.
  31.  
  32. Kenneth Cobler        ksc@cbnewsk.att.com or ken@ihlpm.att.com
  33. AT&T Bell Laboratories    attmail!cbnewsk!ksc or attmail!ihlpm!ken
  34. 2000 N. Naperville Rd.
  35. Naperville, IL  60566
  36.