meta-arago.lists.yoctoproject.org archive mirror
 help / color / mirror / Atom feed
* [meta-arago][dunfell][PATCH] weston-init: fix killproc for thinlinux so that it doesn't kill itself
@ 2022-05-02 21:35 Darren Etheridge
  0 siblings, 0 replies; only message in thread
From: Darren Etheridge @ 2022-05-02 21:35 UTC (permalink / raw)
  To: nm, denys, reatmon, k-bhargav, meta-arago

busybox pidof doesn't omit the current pid
as this script is called weston on the target
in thinlinux with a busybox based utility load
later killproc operations end up killing this
script, which leads to the script not actually
starting weston.

Signed-off-by: Darren Etheridge <detheridge@ti.com>
---
 .../recipes-graphics/wayland/weston-init/init   | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/meta-arago-distro/recipes-graphics/wayland/weston-init/init b/meta-arago-distro/recipes-graphics/wayland/weston-init/init
index 461b0787..1f55ab76 100644
--- a/meta-arago-distro/recipes-graphics/wayland/weston-init/init
+++ b/meta-arago-distro/recipes-graphics/wayland/weston-init/init
@@ -9,8 +9,21 @@
 ### END INIT INFO
 
 killproc() {
-        pid=`/bin/pidof $1`
-        [ "$pid" != "" ] && kill $pid
+	all_pids=`/bin/pidof $1`
+
+	# busybox pidof doesn't ommit the current pid
+	# as this script is called weston on the target
+	# in thinlinux with a busybox based utility load
+	# later killproc operations end up killing this
+	# script.
+	for pid in $all_pids
+	do
+		if [ "$pid" != "$$" ]; then
+			kill_pids+=$pid
+		fi
+	done
+
+	[ "$kill_pids" != "" ] && kill $kill_pids
 }
 
 read CMDLINE < /proc/cmdline
-- 
2.17.1



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-05-02 21:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-02 21:35 [meta-arago][dunfell][PATCH] weston-init: fix killproc for thinlinux so that it doesn't kill itself Darren Etheridge

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).