Browse Source

only generate shared secret for rndc if named will be started.

tested by grange@, ok millert@
OPENBSD_3_3
jakob 22 years ago
parent
commit
971287e482
1 changed files with 11 additions and 11 deletions
  1. +11
    -11
      src/etc/rc

+ 11
- 11
src/etc/rc View File

@ -1,4 +1,4 @@
# $OpenBSD: rc,v 1.220 2003/03/04 22:45:53 jakob Exp $
# $OpenBSD: rc,v 1.221 2003/03/04 23:37:15 jakob Exp $
# System startup script run by init on autoboot
# or after single-user.
@ -204,19 +204,19 @@ if [ X"${pf}" != X"NO" -a X"${pflogd_flags}" != X"NO" ]; then
pflogd ${pflogd_flags}
fi
if ! cmp -s /etc/rndc.key /var/named/etc/rndc.key ; then
echo -n "rndc-confgen: generating new shared secret... "
if /usr/sbin/rndc-confgen -a -t /var/named >/dev/null 2>&1; then
chmod 0640 /var/named/etc/rndc.key >/dev/null 2>&1
echo done.
else
echo failed.
fi
fi
# $named_flags are imported from /etc/rc.conf;
# if $named_flags != NO, named is run.
if [ "X${named_flags}" != X"NO" ]; then
if ! cmp -s /etc/rndc.key /var/named/etc/rndc.key ; then
echo -n "rndc-confgen: generating new shared secret... "
if /usr/sbin/rndc-confgen -a -t /var/named >/dev/null 2>&1; then
chmod 0640 /var/named/etc/rndc.key >/dev/null 2>&1
echo done.
else
echo failed.
fi
fi
echo 'starting named'; named $named_flags
fi


Loading…
Cancel
Save