blob: 7c4bc5b64a561e59fe711d365875f81b6edde8cc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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#
|