The -r option has been removed from rndc-confgen since bind 9.13[1].
Fix the bind startup error:
$ /etc/init.d/bind start
Starting domain name service: namedrndc-confgen: The -r option has been deprecated.
chmod: cannot access '/etc/bind/rndc.key': No such file or directory
[1]: https://gitlab.isc.org/isc-projects/bind9/-/commit/
3a4f820d625c214cfb21f5e6d18ce9160d2a193b
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
@@ -57,6 +57,7 @@ case "$1" in
modprobe capability >/dev/null 2>&1 || true
if [ ! -f /etc/bind/rndc.key ]; then
- /usr/sbin/rndc-confgen -a -b 512 -r /dev/urandom
+ /usr/sbin/rndc-confgen -a -b 512
+ chown root:bind /etc/bind/rndc.key >/dev/null 2>&1 || true
chmod 0640 /etc/bind/rndc.key
fi
+
+ modprobe capability >/dev/null 2>&1 || true
+ if [ ! -f /etc/bind/rndc.key ]; then
-+ /usr/sbin/rndc-confgen -a -b 512 -r /dev/urandom
++ /usr/sbin/rndc-confgen -a -b 512
+ chmod 0640 /etc/bind/rndc.key
+ fi
+ if [ -f /var/run/named/named.pid ]; then