From 1e4e21c5047511d3bf04e4e475803e9bbe29b11a Mon Sep 17 00:00:00 2001 From: Patrick J Volkerding Date: Sun, 25 Apr 2021 19:00:34 +0000 Subject: Sun Apr 25 19:00:34 UTC 2021 d/gdb-10.2-x86_64-1.txz: Upgraded. d/python-pip-21.1-x86_64-1.txz: Upgraded. n/dnsmasq-2.85-x86_64-2.txz: Rebuilt. rc.dnsmasq: display stop message. Thanks to vineetmehta. rc.dnsmasq: kill by .pid file (or at least within the current namespace). Thanks to Petri Kaukasoina. n/wireguard-tools-1.0.20210424-x86_64-1.txz: Upgraded. x/fcitx-qt5-1.2.6-x86_64-1.txz: Upgraded. --- source/n/dnsmasq/rc.dnsmasq | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'source/n/dnsmasq/rc.dnsmasq') diff --git a/source/n/dnsmasq/rc.dnsmasq b/source/n/dnsmasq/rc.dnsmasq index ce584cbd..f19a1723 100644 --- a/source/n/dnsmasq/rc.dnsmasq +++ b/source/n/dnsmasq/rc.dnsmasq @@ -11,7 +11,14 @@ dnsmasq_start() { # Stop dnsmasq: dnsmasq_stop() { - killall dnsmasq + # Try to use the .pid file first: + if pgrep -l -F /var/run/dnsmasq.pid 2> /dev/null | grep -q dnsmasq ; then + echo "Stopping dnsmasq." + pkill -F /var/run/dnsmasq.pid 2> /dev/null + else # kill any dnsmasq processes in this namespace: + echo "Stopping dnsmasq." + killall --ns $$ dnsmasq 2> /dev/null + fi } # Restart dnsmasq: -- cgit v1.2.3