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

  1. Newsgroups: comp.unix.programmer,comp.unix.,wizards
  2. Path: sparky!uunet!usc!wupost!sdd.hp.com!news.cs.indiana.edu!usenet.ucs.indiana.edu!newshost.cs.rose-hulman.edu!news
  3. From: sullivan@cs.rose-hulman.edu (Fred Sullivan)
  4. Subject: Re: How to restart a process after the machine is up.
  5. In-Reply-To: jhu@bronze.ucs.indiana.edu's message of Mon, 17 Aug 1992 03:16:21 GMT
  6. Message-ID: <SULLIVAN.92Aug17154930@liz.cs.rose-hulman.edu>
  7. Sender: news@cs.rose-hulman.edu (The News Administrator)
  8. Nntp-Posting-Host: liz.cs.rose-hulman.edu
  9. Organization: Rose-Hulman Institute of Technology
  10. References: <Bt3yF9.JFI@usenet.ucs.indiana.edu>
  11. Date: Mon, 17 Aug 1992 20:49:30 GMT
  12. Lines: 20
  13.  
  14. In article <Bt3yF9.JFI@usenet.ucs.indiana.edu> jhu@bronze.ucs.indiana.edu (Jun Hu) writes:
  15.  
  16.        I have a program which needs big amounts of CPU time. It
  17.    has been running on the unix-based machine for a while. Because 
  18.    the machine will be down once every month, I would like to have my 
  19.    process terminated some way (save the core image of the process? ) 
  20.    before the machine is down and restarted manually from the point it 
  21.    stops after the machine is up, so the previous computing time is 
  22.    not wasted.
  23.  
  24. A trick which may or may not be applicable.  If the current state of the 
  25. process is easily saved (say by writing to a file) you can write a signal
  26. handler for an unused signal (e.g. SIGUSR1), which dumps the state.
  27.  
  28. When the program starts up, have it read its starting state from the file.
  29.  
  30. When you want to shut down the machine, just send the process a signal.  I
  31. once used this technique to keep a program running for several months.
  32.  
  33.  
  34.