void-packages/srcpkgs/openresolv/patches/dnsmasq.patch

82 lines
2.3 KiB
Diff

diff --git i/dnsmasq.in w/dnsmasq.in
index 96b5593..384d9df 100644
--- dnsmasq.in
+++ dnsmasq.in
@@ -33,10 +33,9 @@
NL="
"
-: ${dnsmasq_pid:=/var/run/dnsmasq.pid}
-[ -s "$dnsmasq_pid" ] || dnsmasq_pid=/var/run/dnsmasq/dnsmasq.pid
: ${dnsmasq_service:=dnsmasq}
: ${dnsmasq_restart:=@RESTARTCMD ${dnsmasq_service}@}
+: ${dnsmasq_reload:=/usr/bin/systemctl reload ${dnsmasq_service}}
newconf="# Generated by resolvconf$NL"
newresolv="$newconf"
@@ -182,7 +181,7 @@ if $changed; then
eval $dnsmasq_restart
fi
if $dbus; then
- $changed || kill -HUP $(cat "$dnsmasq_pid")
+ $changed || eval $dnsmasq_reload
# Send even if empty so old servers are cleared
if $dbus_ex; then
method=SetDomainServers
diff --git i/resolvconf.conf.5.in w/resolvconf.conf.5.in
index 81fe154..9b4f1bd 100644
--- resolvconf.conf.5.in
+++ resolvconf.conf.5.in
@@ -215,8 +215,8 @@ variables, documented below.
Location of the dnsmasq service.
.It Sy dnsmasq_restart
Command to restart the dnsmasq service.
-.It Sy dnsmasq_pid
-Location of the dnsmasq pidfile.
+.It Sy dnsmasq_reload
+Command to reload the dnsmasq service.
.It Sy libc_service
Location of the libc service.
.It Sy libc_restart
@@ -229,10 +229,8 @@ Command to restart the named service.
Command to restart the pdnsd service.
.It Sy unbound_service
Location of the unbound service.
-.It Sy unbound_restart
-Command to restart the unbound service.
-.It Sy unbound_pid
-Location of the unbound pidfile.
+.It Sy unbound_reload
+Command to reload the unbound service.
.Sh SEE ALSO
.Xr resolv.conf 5
and
diff --git i/unbound.in w/unbound.in
index 4ee0da7..5e4a326 100644
--- unbound.in
+++ unbound.in
@@ -33,9 +33,8 @@
NL="
"
-: ${unbound_pid:=/var/run/unbound.pid}
: ${unbound_service:=unbound}
-: ${unbound_restart:=@RESTARTCMD ${unbound_service}@}
+: ${unbound_reload:=/usr/bin/systemctl reload-or-try-restart ${unbound_service}}
newconf="# Generated by resolvconf$NL"
for d in $DOMAINS; do
@@ -67,12 +66,5 @@ if [ ! -f "$unbound_conf" ] || \
[ "$(cat "$unbound_conf")" != "$(printf %s "$newconf")" ]
then
printf %s "$newconf" >"$unbound_conf"
- # If we can't sent a HUP then force a restart
- if [ -s "$unbound_pid" ]; then
- if ! kill -HUP $(cat "$unbound_pid") 2>/dev/null; then
- eval $unbound_restart
- fi
- else
- eval $unbound_restart
- fi
+ eval $unbound_reload
fi