From 00ce2dfdd859af68341c52a96ee51375eb79ed29 Mon Sep 17 00:00:00 2001 From: Patrick J Volkerding Date: Fri, 3 Sep 2021 18:51:49 +0000 Subject: Fri Sep 3 18:51:49 UTC 2021 a/gzip-1.11-x86_64-1.txz: Upgraded. a/kernel-firmware-20210903_2984e26-noarch-1.txz: Upgraded. a/kernel-generic-5.14.1-x86_64-1.txz: Upgraded. a/kernel-huge-5.14.1-x86_64-1.txz: Upgraded. a/kernel-modules-5.14.1-x86_64-1.txz: Upgraded. d/kernel-headers-5.14.1-x86-1.txz: Upgraded. k/kernel-source-5.14.1-noarch-1.txz: Upgraded. kde/kstars-3.5.4-x86_64-1.txz: Upgraded. n/bind-9.16.20-x86_64-2.txz: Rebuilt. rc.bind: Fixed typo: $RDNC_OPTIONS -> $RNDC_OPTIONS rc.bind: Allow a 10 second (default) timeout for rndc to stop BIND. At that point if BIND is still running, use killall -SIGTERM to stop it. Thanks to akschu. xap/ssr-0.4.3-x86_64-1.txz: Upgraded. isolinux/initrd.img: Rebuilt. kernels/*: Upgraded. usb-and-pxe-installers/usbboot.img: Rebuilt. --- source/n/bind/bind.SlackBuild | 2 +- source/n/bind/rc.bind | 43 +++++++++++++++++++++++++++---------------- 2 files changed, 28 insertions(+), 17 deletions(-) (limited to 'source/n') diff --git a/source/n/bind/bind.SlackBuild b/source/n/bind/bind.SlackBuild index 1b7af895..783ef548 100755 --- a/source/n/bind/bind.SlackBuild +++ b/source/n/bind/bind.SlackBuild @@ -24,7 +24,7 @@ cd $(dirname $0) ; CWD=$(pwd) PKGNAM=bind VERSION=${VERSION:-$(echo ${PKGNAM}-[0-9]*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} # Automatically determine the architecture we're building on: if [ -z "$ARCH" ]; then diff --git a/source/n/bind/rc.bind b/source/n/bind/rc.bind index f7a68776..cab75163 100644 --- a/source/n/bind/rc.bind +++ b/source/n/bind/rc.bind @@ -91,26 +91,37 @@ bind_start() { # Stop all running copies of BIND (/usr/sbin/named): bind_stop() { - echo "Stopping BIND: /usr/sbin/rndc $RDNC_OPTIONS stop" - /usr/sbin/rndc $RDNC_OPTIONS stop - # A problem with using "/usr/sbin/rndc stop" is that if you - # managed to get multiple copies of named running it will - # only stop one of them and then can't stop the others even - # if you run it again. So, after doing things the nice way - # we'll do them the old-fashioned way. If you don't like - # it you can comment it out, but unless you have a lot of - # other programs you run called "named" this is unlikely - # to have any ill effects: - sleep 1 - if ps axc | grep -q named ; then - echo "Stopping all named processes in this namespace: /bin/killall --ns \$\$ named" - /bin/killall --ns $$ named 2> /dev/null + # If you've set up rndc, we can use this to make shutting down BIND faster. + # If you have /etc/rndc.conf, or you have /etc/rndc.key, or $RNDC_OPTIONS is + # not empty, we'll try it. + if [ -r /etc/rndc.conf -o -r /etc/rndc.key -o ! -z "$RNDC_OPTIONS" ]; then + if [ -z "$RNDC_OPTIONS" ]; then + echo "Stopping BIND: /usr/sbin/rndc stop" + else + echo "Stopping BIND: /usr/sbin/rndc $RNDC_OPTIONS stop" + fi + /usr/sbin/rndc $RNDC_OPTIONS stop + # Wait for up to $TIMEOUT seconds before moving on to try killall: + TIMEOUT=${TIMEOUT:-10} + while [ "$TIMEOUT" -gt "0" ]; do + # Exit the timeout loop if there are no named processes: + if ! ps axco command | grep -q -e "^named$"; then + break + fi + sleep 1 + TIMEOUT=$(expr $TIMEOUT - 1) + done + fi + # Kill named processes if there are any running: + if ps axco command | grep -q -e "^named$"; then + echo "Stopping all named processes in this namespace: /bin/killall -SIGTERM --ns \$\$ named" + /bin/killall -SIGTERM --ns $$ named 2> /dev/null fi } # Reload BIND: bind_reload() { - /usr/sbin/rndc $RDNC_OPTIONS reload + /usr/sbin/rndc $RNDC_OPTIONS reload } # Restart BIND: @@ -121,7 +132,7 @@ bind_restart() { # Get BIND status: bind_status() { - /usr/sbin/rndc $RDNC_OPTIONS status + /usr/sbin/rndc $RNDC_OPTIONS status } case "$1" in -- cgit v1.2.3