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