Re: [htdig] start/stop/restart


Subject: Re: [htdig] start/stop/restart
From: David Robley (huntsman@www.nisu.flinders.edu.au)
Date: Thu Jul 20 2000 - 19:27:42 PDT


On 20 Jul, Franck Horlaville wrote:
>>In the Bourne shell, as well as bash, the "$!" pseudo-variable will give
>>you the PID of the last background process it started with an "&".
>
> so it would look like something like this
>
> my current start script :
>
> #changed :
> #/Local/Library/WebServer/htdig/bin/rundig -v -l -s -a > /var/log/htdig.log
> #to :
> /Local/Library/WebServer/htdig/bin/rundig -v -l -s -a &
> echo $! > /var/run/htdig.pid
>
> problems :
>
> a/ Got to either remove -v or find the correct syntax to output to the logfile

You want the output from -v to go to the log file? If so, try adding
2>&1 t oredirect stderror to stdout, otherwise stderror goes to the
consol;e regardless of the redirect > So your command would look like:

/Local/Library/WebServer/htdig/bin/rundig -v -l -s -a > /var/log/htdig.log 2>&1

> b/ The pid I get is the one of my shell running rundig (obviously).
> Problem : when I kill it htdig continues to run.
>
> solution : change rundig to call htdig with &
> problem : how do I know it's dead so I can call htmerge ?

grep for htdig in the output of ps ax? Or issue a killall htdig? Or you
could use the grep technique in your while loop below.

>
> idea : add this to rundig :
>
> while [the pid exists, syntax anyone ?]
> do sleep 600
> done
> htmerge ...
>
> Is this a good solution ?
>
> Thanks a bunch
> --
> Franck Horlaville

Cheers

-- 
David Robley                        | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES  | http://www.nisu.flinders.edu.au/
AusEinet                            | http://auseinet.flinders.edu.au/
            Flinders University, ADELAIDE, SOUTH AUSTRALIA

------------------------------------ To unsubscribe from the htdig mailing list, send a message to htdig-unsubscribe@htdig.org You will receive a message to confirm this.



This archive was generated by hypermail 2b28 : Thu Jul 20 2000 - 09:29:35 PDT