diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-06 00:55:53 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-06 00:55:53 +0000 |
commit | 129b974b59c74140570847bb4a2774d41d1e5fae (patch) | |
tree | f2dc68e7186b8157e33aebbc2526e016912ded82 /debian/knot-resolver.postinst | |
parent | Adding upstream version 3.2.1. (diff) | |
download | knot-resolver-129b974b59c74140570847bb4a2774d41d1e5fae.tar.xz knot-resolver-129b974b59c74140570847bb4a2774d41d1e5fae.zip |
Adding debian version 3.2.1-3.debian/3.2.1-3debian
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/knot-resolver.postinst')
-rw-r--r-- | debian/knot-resolver.postinst | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/debian/knot-resolver.postinst b/debian/knot-resolver.postinst new file mode 100644 index 0000000..7c4bc5b --- /dev/null +++ b/debian/knot-resolver.postinst @@ -0,0 +1,30 @@ +#!/bin/sh +set -e + +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 + # systemctl of the sub-services is the preferred method to restart + systemctl try-restart 'kresd@*.service' || true + # but if we are running sysvinit, we can try to restart that process anyway + # (kresd.service is masked on systems that use systemd) + invoke-rc.d kresd try-restart || true + fi + exit 0 +fi + +if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then + if [ -d /run/systemd/system ]; then + systemctl try-restart 'kresd@*.service' || true + else + invoke-rc.d kresd try-restart || true + fi +fi + +#DEBHELPER# |