Operating System - HP-UX
1831554 Members
4185 Online
110025 Solutions
New Discussion

Hpux to Sco script getting stuck on startup..

 
Patrick Wallek
Honored Contributor

Re: Hpux to Sco script getting stuck on startup..

Does SCO have the 'at' scheduler? If so, would something like the following work?

remsh scohost -l root "at now < /usr/bin/startivr"

I think you would at least get your prompt back on the HP-UX host with that. I hope.
John Poff
Honored Contributor

Re: Hpux to Sco script getting stuck on startup..

Richard,

Here is another way to do it. On the SCO box, you can write a little script that will run as a daemon. All it needs to do is check for the presence of a file, let's call it run_ivr. If it finds the run_ivr file present, it can run the startup commands. If the file goes away, it can run the halt commands. That way, all you need to do from the HP box is remsh to each SCO box and touch the run_ivr file when you want to start ivr, or remsh and rm run_ivr to stop it.

It's not pretty but it is simple. Let me know if you are interested. I'll be glad to help you with the scripting. I also picked up my networking books from the house during lunch, so I'll dig in there some more. I think remsh/rcmd is about all you'll have to work with, unless somebody knows of some other machinery to do the job.

Patrick's idea about the 'at' job is a good one. I've used that trick before to start ill-behaved programs.

JP
someone_4
Honored Contributor

Re: Hpux to Sco script getting stuck on startup..

the at now worked !
It have me
job 993231984.a-4115:0 at Fri Jun 22 12:46:24 2001
and a command promt right back.
I did it on the new re written startivr2 script. And the original startivr script and this did work too. Now I am going to do this on 19 boxes. Are there any run away proccess that I need to check for on the host or the remote host?

thanks

Richard
someone_4
Honored Contributor

Re: Hpux to Sco script getting stuck on startup..

John the script you were talking about sounds really cool. How would you go about doing that?
That maybe helpfull for something else.

thanks

Richard
John Poff
Honored Contributor

Re: Hpux to Sco script getting stuck on startup..

Richard,

Here is something like I was talking about. It's just something I threw together to give you an idea of how it could work. You would run this script on each of the SCO boxes, and when you touch a certain file that the script looks for, it will start the ivr. If ivr is running and that file goes away, it will stop ivr. I've used something like this before to run backups on systems, as well as stop/start databases. I'm sure other people will offer lots of good suggestions to clean up the script, but here is a first cut at it:


#!/bin/ksh

# ivr_daemon

CONTROLFILE=/var/logs/ivr_run # the file we check for to start/stop things
SLEEPTIME=60 # time to sleep in seconds between file checks

while true # loop forever, we are a daemon
do
until [[ -f $CONTROLFILE ]]
do
sleep $SLEEPTIME
done

RUNNINGIVR=$(ps -ef | grep ivr | grep -v grep | wc -l)

if [[ -f $CONTROLFILE ]] # our file shows up...
then

if (( RUNNINGIVR == 0 )) # ...and ivr isn't running...
then
nohup ./startivr & # ...so let's start it
fi

else

if (( RUNNINGIVR > 0 )) # ivr is running and the control file is gone...
then
nohup ./stopivr & # ...so we stop ivr
fi
fi

done