Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/dnsmasq: provide pidfile along with -x flag
@ 2023-06-16  1:23 Konstantin Menyaev via buildroot
  2023-07-01 20:44 ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 2+ messages in thread
From: Konstantin Menyaev via buildroot @ 2023-06-16  1:23 UTC (permalink / raw)
  To: buildroot; +Cc: Konstantin Menyaev, sdfw_system_team

From: Konstantin Menyaev <KAMenyaev@sberdevices.ru>

Use pidfile for more accurate process match.
Useful in multiple process instances.

Signed-off-by: Konstantin Menyaev <KAMenyaev@sberdevices.ru>
---
 package/dnsmasq/S80dnsmasq | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/package/dnsmasq/S80dnsmasq b/package/dnsmasq/S80dnsmasq
index b052259e87..b2cd56adef 100644
--- a/package/dnsmasq/S80dnsmasq
+++ b/package/dnsmasq/S80dnsmasq
@@ -1,16 +1,21 @@
 #!/bin/sh
 
+NAME="dnsmasq"
+DAEMON="/usr/sbin/$NAME"
+PIDFILE="/var/run/$NAME.pid"
+
 [ -f /etc/dnsmasq.conf ] || exit 0
 
 case "$1" in
 	start)
 		printf "Starting dnsmasq: "
-		start-stop-daemon -S -x /usr/sbin/dnsmasq
+		start-stop-daemon -S -p "$PIDFILE" -x "$DAEMON" -- \
+			--pid-file="$PIDFILE"
 		[ $? = 0 ] && echo "OK" || echo "FAIL"
 		;;
 	stop)
 		printf "Stopping dnsmasq: "
-		start-stop-daemon -K -q -x /usr/sbin/dnsmasq
+		start-stop-daemon -K -q -p "$PIDFILE" -x "$DAEMON"
 		[ $? = 0 ] && echo "OK" || echo "FAIL"
 		;;
 	restart|reload)
-- 
2.40.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-07-01 20:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-16  1:23 [Buildroot] [PATCH 1/1] package/dnsmasq: provide pidfile along with -x flag Konstantin Menyaev via buildroot
2023-07-01 20:44 ` Thomas Petazzoni via buildroot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox