From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96078721911871.tru64-unix-managers.marc@archive.invalid> From: Edward Nowlan Date: Wed, 16 Sep 1998 13:30:45 +0000 To: tru64-unix-managers Subject: How to create a startup script X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96078721911871 Unix 4.0D I am having trouble running startup scripts. I can invoke them once the system is up /sbin/rc3.d/S99autohost start and it works fine, but when the system comes up they appear not to run, as what they are starting is not running after the system comes up. #!/sbin/sh # # Control the autohost daemon # PATH=/usr/local/autohost:/sbin export PATH case "$1" in 'start') set `who -r` if [ $9 = "S" ]; then if /usr/local/autohost/autohost >/dev/null 2>&1 &; then echo "AUTOHOST service started" fi fi ;; 'stop') set `ps -e -o pid,command $* | grep autohost | grep perl` if [ "X$1" != "X" ] then /bin/kill $1 fi ;; 'stop') set `ps -e -o pid,command $* | grep autohost | grep perl` if [ "X$1" != "X" ] then /bin/kill $1 fi ;; *) echo "usage: $0 {start|stop}" ;; esac Protection on the link is: # ls -l S99autohost lrwxrwxrwx 1 root bin 18 Jun 26 18:10 S99autohost -> ../init.d/autohost Protection on actual file: # ls -l /sbin/init.d/autohost -rwxr-x--- 1 root system 496 Jun 26 18:22 /sbin/init.d/autohost The program the script runs is as follows: #define REAL_PATH "/usr/local/autohost/autohost.server" main (ac,av) char **av; { /* Fork, and have the parent exit. The child becomes the server. */ if (fork()) exit(0); execv(REAL_PATH, av); /* If execv fails, exit with error */ exit(1); } The script /usr/local/autohost/autohost.server is a perl script. Thanks for any help you can provide. -- Edward S. Nowlan Networks and Systems Administrator Williams College Voice: 413-597-2082 Fax: 413-597-4103 Email: edward.nowlan@williams.edu