Re: 'service named reload' with non-default system directories.

From: Sean Bruno <sean_bruno_at_yahoo.com>
Date: Wed, 24 Apr 2013 09:27:18 -0700
On Wed, 2013-04-24 at 16:35 +0200, Ian FREISLICH wrote:

> 
> --- /usr/src/etc/rc.d/named     2013-04-15 20:17:58.000000000 +0200
> +++ /etc/rc.d/named     2013-04-24 16:16:52.000000000 +0200
> _at__at_ -109,7 +109,7 _at__at_
>  
>  named_reload()
>  {
> -       ${command%/named}/rndc reload
> +       ${command%/named}/rndc -k ${named_confdir}/rndc.key reload
>  }
>  
>  find_pidfile()
<snip>
> So, I 'include "path/to/rndc.key";' in named.conf, add a controls
> section that uses this named key and I use the following rndc.conf:
> 
> ---named.conf---
> include "/etc/namedb/rndc.key";
> 
> controls {
>         inet 127.0.0.1 allow { 127.0.0.1; } keys { "rndc-key"; };
> };
> ---named.conf---
> 
> ---rndc.conf---
> include "/etc/namedb/rndc.key";
> 
> options {
>         default-server  localhost;
>         default-key     rndc-key;
> };
> 
> server localhost {
>         key     rndc-key;
> };
> ---rndc.conf---
> 
> And the following version of the above patch:
> 
> --- /usr/src/etc/rc.d/named     2013-04-15 20:17:58.000000000 +0200
> +++ /etc/rc.d/named     2013-04-24 16:16:52.000000000 +0200
> _at__at_ -109,7 +109,7 _at__at_
>  
>  named_reload()
>  {
> -       ${command%/named}/rndc reload
> +       ${command%/named}/rndc -c ${named_confdir}/rndc.conf reload
>  }
>  
>  find_pidfile()
> 
> this will allow the rc system to reload and stop named (without a
> kill) no matter what the configured chroot is.
> 
> Ian
> 


Would we need a change to /etc/defaults/rc.conf to set ${named_confdir}
to the default location if not set?

Also, there already appears to be a ${named_conf} that points to
whatever named.conf specified (defaults to /etc/namedb/named.conf).  Is
this complementary to what you're poking at?

Sean

Received on Wed Apr 24 2013 - 14:27:26 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:36 UTC