1838196 Members
3912 Online
110125 Solutions
New Discussion

Startup script hang

 
Don Spare
Regular Advisor

Startup script hang

When I reboot either of my servers I have a problem with the startup of the ARCserve Universal Agent v1.39. The 'asagent' script, which is properly referenced in rc2.d, never exits. If I reboot, I have to login via another terminal and kill the script that is driving it to permit the remainder of the startup sequence to proceed. I have tried forcing an exit in the script at what I thought was an appropriate place but it refuses to relinquish control. The attached script is the one that is actually doing the work. It is called from the /sbin/init.d/asagent script which is listed here:

#!/sbin/sh
# installed by postinstall on Fri Nov 10 13:22:25 EST 2000
case $1 in
'start_msg')
echo "Starting ARCserve Agent:"
;;
'start')
(/usr/CYEagent/asagent start) 2>&1 | /usr/bin/tee /dev/console
;;
'stop_msg')
echo "Stopping ARCserve Agent:"
;;
'stop')
(/usr/CYEagent/asagent stop) 2>&1 | /usr/bin/tee /dev/console
;;
*)
echo "usage: `/usr/bin/basename $0` {start|stop}"
;;
esac

Has anyone seen this behavior before and is there a cure?

Look for 'DJS' in the attached script to see where I tried to make it exit.

3 REPLIES 3
harry d brown jr
Honored Contributor

Re: Startup script hang


Why are you piping the output to tee /dev/console ??

live free or die
harry
Live Free or Die
A. Clay Stephenson
Acclaimed Contributor

Re: Startup script hang

The first thing that I would do is drop the /dev/console redirect through tee and then you might find it necessary to
drop the command int6o background. A well written daemon should 'daemonize' itself but the safe option is to add '&' to cause it to be run in the background.

The other thing that can cause problems (and I didn't bother to look through this script) is that there may be some commands that expect stdin or stdout to be a tty device and the commands will hang if that is not the case.


If it ain't broke, I can fix that.
James R. Ferguson
Acclaimed Contributor

Re: Startup script hang

Hi:

In addition to that already offered, you need to confine your exit values to 0,1 or 2 (and rarely, 3). These return values signal specific actions to the startup/shutdown mechanism. Messages should only be directed to stdout and stderr. A good overview of the processs can still be found here:

http://docs.hp.com/hpux/onlinedocs/os/startup.pdf

Regards!

...JRF...