public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] devshell: Use different termination test to avoid warnings
@ 2020-05-16  8:00 Jan Kiszka
  2020-05-25 16:11 ` Baurzhan Ismagulov
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Kiszka @ 2020-05-16  8:00 UTC (permalink / raw)
  To: isar-users

From: Jan Kiszka <jan.kiszka@siemens.com>

As we run the terminal via a sudo chroot, OE's way of testing for the
existence of the target PID does not work. It will rather fail early due
to missing permissions (user tries to send signal to root process), and
we will wait in the unmount loop, generating warnings like

WARNING: mc:qemuamd64-buster:example-raw-0.3-r0 do_devshell: /work/build/tmp/deploy/buildchroot-target/debian-buster-amd64//home/builder/example-raw: Couldn't unmount, retrying...

This replaces the kill(pid, 0) with a test for the existence of the
corresponding /proc/<pid> directory.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 meta/lib/oe/terminal.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/meta/lib/oe/terminal.py b/meta/lib/oe/terminal.py
index 87058040..a9fb62b9 100644
--- a/meta/lib/oe/terminal.py
+++ b/meta/lib/oe/terminal.py
@@ -245,9 +245,11 @@ def spawn(name, sh_cmd, title=None, env=None, d=None):
     finally:
         os.unlink(pidfile)

+    # Test for /proc entry so that target pid can also be privileged
+    procpid = "/proc/%d" % pid
     while True:
         try:
-            os.kill(pid, 0)
+            os.stat(procpid)
             time.sleep(0.1)
         except OSError:
            return
--
2.26.1


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

end of thread, other threads:[~2020-05-25 16:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-16  8:00 [PATCH] devshell: Use different termination test to avoid warnings Jan Kiszka
2020-05-25 16:11 ` Baurzhan Ismagulov
2020-05-25 16:13   ` Jan Kiszka

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