* How to create a startup script
@ 1998-09-16 13:30 Edward Nowlan
0 siblings, 0 replies; only message in thread
From: Edward Nowlan @ 1998-09-16 13:30 UTC (permalink / raw)
To: tru64-unix-managers
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1998-09-16 13:30 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-09-16 13:30 How to create a startup script Edward Nowlan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox