aboutsummaryrefslogtreecommitdiff
path: root/network/unbound
diff options
context:
space:
mode:
authorBadchay <badchay@protonmail.com>2022-10-14 00:21:54 +0100
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2022-10-15 10:47:32 +0700
commit50a0a2388cc306a050307042730f75b5f329bd69 (patch)
tree46809fce0a7597105458118790748eaf845dcd7a /network/unbound
parentbecb65e515d0831d3bec23b36624bdb0f605899e (diff)
network/unbound: Updated for version 1.17.0.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'network/unbound')
-rw-r--r--network/unbound/rc.unbound36
-rw-r--r--network/unbound/unbound.SlackBuild4
-rw-r--r--network/unbound/unbound.info6
3 files changed, 40 insertions, 6 deletions
diff --git a/network/unbound/rc.unbound b/network/unbound/rc.unbound
index d45d6ff255ac2..b9555c61c4009 100644
--- a/network/unbound/rc.unbound
+++ b/network/unbound/rc.unbound
@@ -6,22 +6,56 @@
UNBOUND=/usr/sbin/unbound
CONFIG=/etc/unbound/unbound.conf
PIDFILE=/var/run/unbound/unbound.pid
+LOGDIR=/var/log/unbound
# Unbound-control is useful but I'm not going to cram it
# down your throat. Set this to "yes" to disable unbound-control
-# initial setup.
+# initial setup. Note that you'll need to disable control port
+# in unbound.conf so Unbound will actually start.
DISABLE_UNBOUND_CONTROL="no"
+# As part of the initial checks, the script makes sure that
+# $LOGDIR exists. It's mostly for cases where admin accidentally
+# deletes the entire log folder rather than individual logs.
+# If you don't use logging at all, have a custom setup or
+# just want to skip these checks, set this to "yes".
+DISABLE_LOGDIR_CHECKS="no"
+
initchecks() {
+ # Look out for a stale pidfile. If there's one, remove it.
+ # This shouldn't be necessary unless the system was shutdown uncleanly
+ # or if Unbound crashes.
+ if [ -e $PIDFILE ] && [ ! $(pidof unbound) ]; then
+ echo "Looks like Unbound isn't running but there's a stale pid file."
+ echo "Removing $PIDFILE"
+ rm -vf $PIDFILE
+ fi
+ # Check that /var/run/unbound exists. If not, create and chown it.
if [ ! -e $(dirname $PIDFILE) ]; then
mkdir -p $(dirname $PIDFILE)
chown unbound:unbound $(dirname $PIDFILE)
fi
+ # Run the initial setup for unbound-control unless it's disabled.
+ # Mostly relevant for the first time run.
if [ ! -e $(dirname $CONFIG)/unbound_server.pem ] && [ "$DISABLE_UNBOUND_CONTROL" == "no" ]; then
echo "Unbound-control: unbound_server.pem not found."
echo "Running initial setup: /usr/sbin/unbound-control-setup"
/usr/sbin/unbound-control-setup || exit 1
fi
+ # Deleted the entire log directory by accident? Oh well, bound to happen.
+ # Let's fix that right away.
+ if [ "$DISABLE_LOGDIR_CHECKS" == "no" ]
+ then
+ if [ ! -d "$LOGDIR" ]; then
+ echo -n "Unbound log directory not found. Attempting to recreate it... "
+ mkdir $LOGDIR && echo "Success!"
+ fi
+ if [ $(stat -c "%U:%G" "$LOGDIR") != "unbound:unbound" ]; then
+ echo -n "Fixing permissions on the log folder $LOGDIR... "
+ chown -R unbound:unbound $LOGDIR && echo "Success!"
+ fi
+ fi
+
}
start() {
diff --git a/network/unbound/unbound.SlackBuild b/network/unbound/unbound.SlackBuild
index 7bec9a1b1f4e2..21e073482c5b1 100644
--- a/network/unbound/unbound.SlackBuild
+++ b/network/unbound/unbound.SlackBuild
@@ -27,7 +27,7 @@
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=unbound
-VERSION=${VERSION:-1.16.3}
+VERSION=${VERSION:-1.17.0}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -130,7 +130,7 @@ mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a doc/README* doc/FEATURES doc/CREDITS doc/TODO $PKG/usr/doc/$PRGNAM-$VERSION
# Shorten the Changelog and restore its timestamp
-head -n 1000 doc/Changelog > $PKG/usr/doc/$PRGNAM-$VERSION/Changelog
+head -n 500 doc/Changelog > $PKG/usr/doc/$PRGNAM-$VERSION/Changelog
touch -r doc/Changelog $PKG/usr/doc/$PRGNAM-$VERSION/Changelog
# Save the upstream unbound.conf and set some reasonable defaults:
diff --git a/network/unbound/unbound.info b/network/unbound/unbound.info
index 55c07938aa276..de823ec7d885f 100644
--- a/network/unbound/unbound.info
+++ b/network/unbound/unbound.info
@@ -1,8 +1,8 @@
PRGNAM="unbound"
-VERSION="1.16.3"
+VERSION="1.17.0"
HOMEPAGE="https://nlnetlabs.nl/projects/unbound/about/"
-DOWNLOAD="https://www.nlnetlabs.nl/downloads/unbound/unbound-1.16.3.tar.gz"
-MD5SUM="f0a767b32058ae67311e5d3665139d15"
+DOWNLOAD="https://www.nlnetlabs.nl/downloads/unbound/unbound-1.17.0.tar.gz"
+MD5SUM="79c863becb1934f6d467be74240e10b5"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""