Centos named init script

Kevin Darcy kcd at chrysler.com
Tue Jul 22 01:51:22 UTC 2008


Jon Kibler wrote:
> On Thu, Jul 17, 2008 at 7:55 PM, Kevin Darcy <kcd at chrysler.com> wrote:
>   
>> named and named-checkconf share parsing routines and are part of the
>> same subsystem.
>>
>> How would you have debugged differently if the tag had been
>> "named-checkconf"?
>>
>>     
>
> I would have realized it was not named that was crashing during
> startup and would not have wasted a couple of hours trying to figure
> out why named would run fine when I started it via the command line
> (first in the foreground, then in the background) instead of crashing
> when started from the init script. It turns out that I have (according
> to ISC) apparently hit on a bug in named-checkconf (see: bind-9.5.1b1:
> mem.c:918: INSIST(ctx->stats[i].gets == 0U) failed.) thread in this
> list.
>
> Bottom line: named works perfect. named-checkconf crashes and burns. I
> would have looked in the right place the first time!
>   
Trouble is, the *vast* majority of things that would be logged by that 
init code would be syntax errors in named.conf. named-checkconf crashing 
would comprise only a *tiny* subset. Optimize for the general case. I 
think "named" is the correct category to use for general run-of-the-mill 
named.conf syntax errors, since that will affect named and named-conf 
equally, and named is the process you really *need* to run.

The init script could be made more intelligent, of course. The exit code 
can be parsed to reveal whether named-checkconf crashed or not, e.g.

           named_err="`${EXEDIR}/named-checkconf $ckcf_options
$named_conf 2>&1`";
# Check whether named-checkconf crashed or not
	   if [ $named_err > 128 ]
	   then
		echo
		echo "named-checkconf crashed"	
		if [ -x /usr/bin/logger ]; then
               		echo "$named_err" | /usr/bin/logger -pdaemon.error -tnamed-checkconf
           	fi;


(I'm assuming here that CentOS treats exit codes the same as other members of the Unix/Linux family).

"named-checkconf" would be the appropriate category if the program actually crashes.

								- Kevin







More information about the bind-users mailing list