Scripts problems trying to start at boot time.

From: Patrick Norris <Patrick.Norris_at_trw.com>
Date: Thu, 25 Jan 2001 18:27:42 -0800

On some of our systems, we would like to have a script call an application (an Ada main program) to start it running as the system boots up.

We think we've got all the links and scripts configured correctly in init.d and rcX.d, including passing the required argument with the calling script, but it never manages to start. We've even moved it up from 99 in the start scripts to just between two of the others that start up just fine.

If we execute the script by hand, it works just as we expect.

Can anyone offer suggestions on what we've overlooked on the following script that keeps us from getting the application running at boot?

Thanks,
-Patrick Norris
Patrick.Norris_at_trw.com

--------------script as 'running'-------------
#!/bin/sh
#
#
PATH=/sbin:/usr/sbin:/usr/bin:/Application_Code/lec:/Application_Code/lcf
export PATH
HOST=`/usr/sbin/rcmgr get HOSTNAME`
SYSTEM='/usr/sbin/rcmgr get STARTSYSTEM'
/bin/echo "Starting Application Software"
case $1 in
'start')
     if [ "$HOST" = "cenetlec" ]
     then
       /Application_Code/lec/ada_main &
       /bin/echo ""
       /bin/echo "LEC is coming up !"
     else
       if [ "$HOST" = "cenetlcf" ]
       then
         /Application_Code/lcf/ada_main &
         /bin/echo ""
         /bin/echo "LCF is coming up !"
       else
         /bin/echo ""
         /bin/echo "Invalid host.....application code not initiated !"
       fi
     fi
     ;;
'stop')
     if [ "$HOST" = "cenetlec" ]
     then
       pid=`/bin/ps -e -o pid,command | awk '{ if ($2 == "/Application_Code/lec/ada_main") print $1 }'`
       else
       pid=`/bin/ps -e -o pid,command | awk '{ if ($2 == "/Application_Code/lcf/ada_main") print $1 }'`
     fi
     if [ "X$pid" != "X" ]
     then
       /bin/kill -9 $pid
       /bin/echo "Application software is going down"
     fi
     ;;
*)
     $ECHO "usage: $0 {start|stop}"
     ;;
esac
Received on Fri Jan 26 2001 - 04:06:20 NZDT

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:41 NZDT