Scripts to start and stop

Bill Larson wllarso at swcp.com
Fri May 25 17:25:35 UTC 2001


> 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