slackware-current/source/n/bind/rc.bind
Patrick J Volkerding 9a67067c0e Thu Sep 16 02:52:54 UTC 2021
a/etc-15.0-x86_64-17.txz:  Rebuilt.
  Added named:named (53:53) user and group.
a/kernel-firmware-20210915_198ac65-noarch-1.txz:  Upgraded.
a/kernel-generic-5.14.4-x86_64-1.txz:  Upgraded.
a/kernel-huge-5.14.4-x86_64-1.txz:  Upgraded.
a/kernel-modules-5.14.4-x86_64-1.txz:  Upgraded.
ap/sudo-1.9.8-x86_64-1.txz:  Upgraded.
d/kernel-headers-5.14.4-x86-1.txz:  Upgraded.
k/kernel-source-5.14.4-noarch-1.txz:  Upgraded.
kde/breeze-icons-5.85.0-noarch-2.txz:  Rebuilt.
  Patched with upstream commit to allow using this icon theme with Xfce.
l/fluidsynth-2.2.3-x86_64-1.txz:  Upgraded.
l/python-charset-normalizer-2.0.5-x86_64-1.txz:  Upgraded.
l/qca-2.3.4-x86_64-1.txz:  Upgraded.
n/NetworkManager-1.32.10-x86_64-3.txz:  Rebuilt.
  Switch to dhcp=internal to avoid problems swimming upstream.
  For those looking for a fix to continue using dhcpcd, a PRIVSEP build
  variable was added to the SlackBuild, and you may produce a fully
  NetworkManager compatible dhcpcd package with this command:
  PRIVSEP=no ./dhcpcd.SlackBuild
  Privilege separation remains the dhcpcd package default as we don't want
  to weaken security for those using rc.inet1 along with dhcpcd.
  Some additional comments about this were added to 00-dhcp-client.conf
  mentioning this and the workaround of killing dhcpcd manually when
  resuming with the stock dhcpcd package.
n/bind-9.16.21-x86_64-1.txz:  Upgraded.
  Fixed call to rndc-confgen in the install script.
  Make /etc/rndc.key owned by named:named.
  Run named as named:named by default (configurable in /etc/default/named).
  rc.bind: chown /run/named and /var/named to configured user:group.
  Thanks to Ressy for prompting this cleanup. :)
n/curl-7.79.0-x86_64-1.txz:  Upgraded.
  This update fixes security issues:
  clear the leftovers pointer when sending succeeds.
  do not ignore --ssl-reqd.
  reject STARTTLS server response pipelining.
  For more information, see:
    https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-22945
    https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-22946
    https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-22947
  (* Security fix *)
n/links-2.24-x86_64-1.txz:  Upgraded.
n/wireguard-tools-1.0.20210914-x86_64-1.txz:  Upgraded.
x/libinput-1.19.0-x86_64-1.txz:  Upgraded.
xap/gimp-2.10.28-x86_64-1.txz:  Upgraded.
isolinux/initrd.img:  Rebuilt.
kernels/*:  Upgraded.
usb-and-pxe-installers/usbboot.img:  Rebuilt.
2021-09-16 09:04:01 +02:00

132 lines
3.7 KiB
Bash

#!/bin/sh
# Start/stop/restart the BIND name server daemon (named).
# Start BIND. By default this will run with user "named". If you'd like to
# change this or other options, see: /etc/default/named
# You might also consider running BIND in a "chroot jail",
# a discussion of which may be found in
# /usr/doc/Linux-HOWTOs/Chroot-BIND-HOWTO.
# One last note: rndc has a lot of other nice features that it is not
# within the scope of this start/stop/restart script to support.
# For more details, see "man rndc" or just type "rndc" to see the options.
# Load command defaults:
if [ -f /etc/default/named ] ; then . /etc/default/named ; fi
if [ -f /etc/default/rndc ] ; then . /etc/default/rndc ; fi
# In case /etc/default/named was missing:
if [ -z "$BIND_USER" ]; then
BIND_USER="named"
fi
if [ -z "$BIND_GROUP" ]; then
BIND_GROUP="named"
fi
if [ -z "$BIND_OPTIONS" ]; then
BIND_OPTIONS="-u $BIND_USER"
fi
# Sanity check. If /usr/sbin/named is missing then it
# doesn't make much sense to try to run this script:
if [ ! -x /usr/sbin/named ]; then
echo "/etc/rc.d/rc.bind: no /usr/sbin/named found (or not executable); cannot start."
exit 1
fi
# Start BIND. As many times as you like. ;-)
# Seriously, don't run "rc.bind start" if BIND is already
# running or you'll get more than one copy running.
bind_start() {
# Make sure /var/run/named exists:
mkdir -p /var/run/named
# Make sure that /var/run/named has correct ownership:
chown -R ${BIND_USER}:${BIND_GROUP} /var/run/named
# Make sure that /var/named has correct ownership:
chown -R ${BIND_USER}:${BIND_GROUP} /var/named
# Start named:
if [ -x /usr/sbin/named ]; then
echo "Starting BIND: /usr/sbin/named $NAMED_OPTIONS"
/usr/sbin/named $NAMED_OPTIONS
sleep 1
fi
# Make sure that named started:
if ! ps axc | grep -q named ; then
echo "WARNING: named did not start."
echo "Attempting to start named again: /usr/sbin/named $NAMED_OPTIONS"
/usr/sbin/named $NAMED_OPTIONS
sleep 1
if ps axc | grep -q named ; then
echo "SUCCESS: named started."
else
echo "FAILED: Sorry, a second attempt to start named has also failed."
echo "There may be a configuration error that needs fixing. Good luck!"
fi
fi
}
# Stop all running copies of BIND (/usr/sbin/named):
bind_stop() {
# 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 $RNDC_OPTIONS reload
}
# Restart BIND:
bind_restart() {
bind_stop
bind_start
}
# Get BIND status:
bind_status() {
/usr/sbin/rndc $RNDC_OPTIONS status
}
case "$1" in
'start')
bind_start
;;
'stop')
bind_stop
;;
'reload')
bind_reload
;;
'restart')
bind_restart
;;
'status')
bind_status
;;
*)
echo "usage $0 start|stop|reload|restart|status"
esac