The problem we were having with our start scripts has been resolved, thanks to the following people who all offered helpful suggestions:
Edward Nowlan [Edward.S.Nowlan_at_williams.edu]
Serguei Patchkovskii [patchkov_at_ucalgary.ca]
Karel Sandler [sandler_at_ujf.cas.cz]
Gerhard Nolte [gnolte_at_gwdg.de]
Oisin McGuinness [oisin_at_sbcm.com]
Claudio Tantignone [C_Tantignone_at_sondaarg.com.ar]
Dr. Thomas.Blinn_at_Compaq.com [tpb_at_doctor.zk3.dec.com]
John Venier [venier_at_odin.mdacc.tmc.edu]
Peyton Bland [bland_at_umich.edu]
O'Brien, Pat [pobrien_at_mitidata.com]
Jerome M Berkman [jerry_at_uclink.berkeley.edu]
Jim Belonis [belonis_at_dirac.phys.washington.edu]
Rasal Kumarage [Rasal.Kumarage_at_asx.com.au]
William H. Magill [magill_at_isc.upenn.edu]
(I hope I didn't miss anyone!)
The suggestions included hints to make the debugging go smoother, checking the parameter being passed in, making sure the PATH was as expected, improvements in capturing the output, sleep delay to allow the application to 'take hold', to using nohup. (I even had someone point out that the 's on one of the lines should have been `s)
The big trick when checking this all out was the need to reboot the system to properly check out the changes - with different groups using the system for testing at this time, it took longer to apply the fixes than anticipated. But, now, all is working.
The solution was making the call to start the application using 'nohup' (for a good write-up on why, I'm including the information from Oisin McGuinness following the summary.) But, after testing on other platforms, we found that the timing would on some machines require the use of a 'sleep' command following the call to start the application. So, with a combination of 'nohup' and 'sleep' it all works correctly!
Thanks to all,
-Patrick Norris
Explanation for nohup/hup from Oisin McGuinness:
When init runs the startup scripts for the various levels, the programs receive HUP signal(s).
(Usual convention for daemons to reread their config files.)
Therefore any daemons/applications/boondoggles that your startup scripts run should
a) either handle SIGHUP gracefully,
b) be started with a nohup in the command line.
Oisin McGuinness
> -----Original Message-----
> From: Norris (Non-TRW), Patrick
> Sent: Thursday, January 25, 2001 6:28 PM
> To: tru64-unix-managers_at_ornl.gov
> Subject: Scripts problems trying to start at boot time.
>
>
> 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:/Applicati
> on_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 Wed Jan 31 2001 - 19:57:21 NZDT