]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
distro/pkg/deb: maintainer scripts cleanup
authorJakub Ružička <jakub.ruzicka@nic.cz>
Tue, 23 May 2023 10:44:47 +0000 (12:44 +0200)
committerJakub Ružička <jakub.ruzicka@nic.cz>
Thu, 22 Jun 2023 14:06:26 +0000 (16:06 +0200)
Remove 4 to 5 upgrade scripts and more.

distro/pkg/deb/knot-resolver-core.postinst
distro/pkg/deb/knot-resolver-core.postrm
distro/pkg/deb/knot-resolver-core.preinst [deleted file]
distro/pkg/deb/knot-resolver-core.triggers [deleted file]
distro/pkg/deb/knot-resolver-module-http.preinst [deleted file]

index fb2bce2fa5be2f8ec25d56e9a2965369750302cd..a1fcadd2fbf6eac9967b0a8fb8b262c02a2f7015 100644 (file)
@@ -2,33 +2,10 @@
 # SPDX-License-Identifier: GPL-3.0-or-later
 set -e
 
-# upgrade-4-to-5
-export UPG_DIR=/var/lib/knot-resolver/.upgrade-4-to-5
-if [ -f ${UPG_DIR}/.unfinished ] ; then
-       rm -f ${UPG_DIR}/.unfinished
-       kresd -c /usr/lib/knot-resolver/upgrade-4-to-5.lua >/dev/null 2>/dev/null
-       echo "\n   !!! WARNING !!!"
-       echo "Knot Resolver configuration file requires manual upgrade.\n"
-       cat ${UPG_DIR}/kresd.conf.net 2>/dev/null
-fi
-
 if [ "$1" = "configure" ]; then
     adduser --quiet --system --group --no-create-home --home /var/cache/knot-resolver knot-resolver
 fi
 
-# Restart any running kresd instances if the root key is updated.
-# Note: if knot-resolver upstream watches this file and reloads it
-# upon a change, we can and should remove this trigger.
-if [ "$1" = "triggered" ]; then
-    if [ "$2" = "/usr/share/dns/root.key" ]; then
-        # use daemon-reload to load any unit changes
-        systemctl daemon-reload || true
-        # systemctl of the sub-services is the preferred method to restart
-        systemctl try-restart 'kresd@*.service' kres-cache-gc.service || true
-    fi
-    exit 0
-fi
-
 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
     systemctl daemon-reload || true
     systemd-tmpfiles --create /usr/lib/tmpfiles.d/knot-resolver.conf
index 4c8a1ea8a05079d97436449663256540947423b2..e58149548313f03fa76f870846e3cbcde22cade1 100644 (file)
@@ -3,7 +3,7 @@
 set -e
 
 if [ "$1" = "remove" ]; then
-    systemctl stop system-kresd.slice || true
+    deb-systemd-invoke stop system-kresd.slice || true
 fi
 
 #DEBHELPER#
diff --git a/distro/pkg/deb/knot-resolver-core.preinst b/distro/pkg/deb/knot-resolver-core.preinst
deleted file mode 100644 (file)
index 1f8f589..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/sh
-# SPDX-License-Identifier: GPL-3.0-or-later
-set -e
-
-# upgrade-4-to-5
-if [ -f /lib/systemd/system/kresd.socket ] ; then
-       export UPG_DIR=/var/lib/knot-resolver/.upgrade-4-to-5
-       mkdir -p ${UPG_DIR}
-       touch ${UPG_DIR}/.unfinished
-
-       for sock in kresd.socket kresd-tls.socket ; do
-               if systemctl is-enabled ${sock} 2>/dev/null | grep -qv masked ; then
-                       systemctl show ${sock} -p Listen > ${UPG_DIR}/${sock}
-                       case "$(systemctl show ${sock} -p BindIPv6Only)" in
-                       *ipv6-only)
-                               touch ${UPG_DIR}/${sock}.v6only
-                               ;;
-                       *default)
-                               if cat /proc/sys/net/ipv6/bindv6only | grep -q 1 ; then
-                                       touch ${UPG_DIR}/${sock}.v6only
-                               fi
-                               ;;
-                       esac
-               fi
-       done
-fi
diff --git a/distro/pkg/deb/knot-resolver-core.triggers b/distro/pkg/deb/knot-resolver-core.triggers
deleted file mode 100644 (file)
index e8d8246..0000000
+++ /dev/null
@@ -1 +0,0 @@
-interest-noawait /usr/share/dns/root.key
diff --git a/distro/pkg/deb/knot-resolver-module-http.preinst b/distro/pkg/deb/knot-resolver-module-http.preinst
deleted file mode 100644 (file)
index c2bd87d..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/sh
-# SPDX-License-Identifier: GPL-3.0-or-later
-set -e
-
-# upgrade-4-to-5
-if [ -f /lib/systemd/system/kresd-doh.socket ] ; then
-       export UPG_DIR=/var/lib/knot-resolver/.upgrade-4-to-5
-       mkdir -p ${UPG_DIR}
-       touch ${UPG_DIR}/.unfinished
-
-       for sock in kresd-webmgmt.socket kresd-doh.socket ; do
-               if systemctl is-enabled ${sock} 2>/dev/null | grep -qv masked ; then
-                       systemctl show ${sock} -p Listen > ${UPG_DIR}/${sock}
-                       case "$(systemctl show ${sock} -p BindIPv6Only)" in
-                       *ipv6-only)
-                               touch ${UPG_DIR}/${sock}.v6only
-                               ;;
-                       *default)
-                               if cat /proc/sys/net/ipv6/bindv6only | grep -q 1 ; then
-                                       touch ${UPG_DIR}/${sock}.v6only
-                               fi
-                               ;;
-                       esac
-               fi
-       done
-fi