bind/script question

Kevin Darcy kcd at daimlerchrysler.com
Thu May 31 21:11:07 UTC 2001


Traditionally:

if kill -0 `cat /var/run/named.pid`; then echo up; else echo down;fi

(At least, that works in Bourne shell. Obviously you'd replace one or both
echo's with whatever you needed. Note that you have to run this with sufficient
permissions -- superuser or whatever ID you run named as -- otherwise you'll
have to do more work to parse the result).

You could probably replace that "kill" command with an "ndc status" if you
wish.


- Kevin


MegaNet Domainreg. wrote:

> Does anyone on this list know how I would go about, usind a bash script,
> finding out the status of named (up/down). I would get to know if its
> currently up, it it is the script would do nothing if its down the script
> would make named use the last know working boot.conf file which would be
> backed up everynight. I just need to know how to check if named is up or
> down and based on that have a bunch of if statements that would do certain
> things. I need this because last night my name server went down and it was
> because of a double entrie in the boot.conf file. Im trying to prevent this
> by have a script start named and based on rather it started or not to
> execute a few things, for example if for whatever reason named doesn't start
> make a backup copy of that boot.conf that has problems then replace it with
> the last know working .conf file. At least this way its still up until i can
> look.
>
> ----------------------------
> Paul Amaral
> ----------------------------





More information about the bind-users mailing list