Scripts to start and stop
Adam Lang
aalang at rutgersinsurance.com
Fri May 25 17:36:44 UTC 2001
Ok, I think I understand... for the first couple minutes I was a bit blank.
I'm on linux, so I would use -aux, correct? The ps options that display
everything?
and the field would be 2 because the second column is what holds the pid
numbers?
so I would have soemthing like this:
$nanny_pid=`ps -aux | grep nanny.pl | awk '{print 2}'` (would I need 2 in
quotes?)
kill -9 $nanny_pid
I'm going to try it out...
Adam Lang
Systems Engineer
Rutgers Casualty Insurance Company
http://www.rutgersinsurance.com
----- Original Message -----
From: "Bill Larson" <wllarso at swcp.com>
To: "Adam Lang" <aalang at rutgersinsurance.com>
Cc: <bind-users at isc.org>
Sent: Friday, May 25, 2001 1:25 PM
Subject: Re: Scripts to start and stop
> > Well, I setup nanny.pl like below and I like it. The only problem is I
do
> > not know how to kill nanny through script. I would normally do kill -9
> > <pid>, but I don't know how to get that pid through script.
>
> You will HAVE to kill the nanny.pl script when you kill named, otherwise
> nanny.pl will simply restart named. Good catch!
>
> To kill nanny.pl, go after it with a brute force attack. Use something
> like:
>
> nanny_pid=`ps PS_OPTS | grep nanny.pl | awk '{print $FIELD}'`
> kill -KILL $nanny_pid
>
> You will have to select the proper "PS_OPTS" and "FIELD" values for
> your OS. For example, under HP-UX, I would use "-elf" for PS_OPTS
> and "4" for FIELD, but every system reports ps output differently.
>
> Also, if nanny.pl is deep in some directory structure, the ps command
> listed my be truncated and "nanny.pl" may not show up.
>
> So, give things a try manually, and then write your script.
>
> Bill Larson
More information about the bind-users
mailing list