home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / unix / question / 10682 < prev    next >
Encoding:
Text File  |  1992-09-02  |  1.2 KB  |  31 lines

  1. Newsgroups: comp.unix.questions
  2. Path: sparky!uunet!wupost!micro-heart-of-gold.mit.edu!snorkelwacker.mit.edu!bloom-picayune.mit.edu!athena.mit.edu!benjy
  3. From: benjy@athena.mit.edu (Benjamin B Thomas)
  4. Subject: Problems using inittab
  5. Message-ID: <1992Sep3.084941.12644@athena.mit.edu>
  6. Sender: news@athena.mit.edu (News system)
  7. Nntp-Posting-Host: e40-008-4.mit.edu
  8. Organization: Massachvsetts Institvte of Technology
  9. Date: Thu, 3 Sep 1992 08:49:41 GMT
  10. Lines: 19
  11.  
  12.     I was wondering if someone could help me clear something up?  The
  13. documentation I have leads me to believe that if I want to run a script from
  14. /etc/inittab at run level 3 and insure that it remains alive, I need to add
  15. this to /etc/inittab:
  16.  
  17. foo :3:respawn:/bin/sh -c 'exec /usr/local/bin/my_script'
  18.  
  19. The script gets executed (ps gives:  ...../usr/local/bin/my_script /usr/local/)
  20. but doesn't work right.
  21.  
  22. The script writes to a tmp file, sleeps, checks some stuff, and then writes
  23. over the tmp file (ls -t > /tmp/foo) This works fine when I execute from the 
  24. command line, but won't write anything when started from inittab.However, it
  25. will write a blank /tmp/foo if I place anything in the file while the process
  26. is sleeping.
  27.  
  28. Any ideas?   BTW It's a csh script.
  29.  
  30.                     -Benjy
  31.