[oe-commits] Jason Wessel : terminal.py: use unique ids for screen sessions

git at git.openembedded.org git at git.openembedded.org
Sat Aug 25 13:52:29 UTC 2012


Module: openembedded-core.git
Branch: master
Commit: 1677b736bca5dc46db522da1874459d2de77209d
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=1677b736bca5dc46db522da1874459d2de77209d

Author: Jason Wessel <jason.wessel at windriver.com>
Date:   Wed Jul 25 12:47:28 2012 -0500

terminal.py: use unique ids for screen sessions

When running multiple sets of builds on the same
system, it is hard to distinguish which build belongs
to which screen session and you can end up resuming
the wrong session.

The simple solution is to just append the process
id to the screen session invocation to make each
unique.

Signed-off-by: Jason Wessel <jason.wessel at windriver.com>
Signed-off-by: Mark Hatle <mark.hatle at windriver.com>
Signed-off-by: Saul Wold <sgw at linux.intel.com>

---

 meta/lib/oe/terminal.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/meta/lib/oe/terminal.py b/meta/lib/oe/terminal.py
index 3131798..30e8f92 100644
--- a/meta/lib/oe/terminal.py
+++ b/meta/lib/oe/terminal.py
@@ -94,9 +94,11 @@ class Screen(Terminal):
     command = 'screen -D -m -t "{title}" -S devshell {command}'
 
     def __init__(self, sh_cmd, title=None, env=None):
+        s_id = "devshell_%i" % os.getpid()
+        self.command = "screen -D -m -t \"{title}\" -S %s {command}" % s_id
         Terminal.__init__(self, sh_cmd, title, env)
         logger.warn('Screen started. Please connect in another terminal with '
-                    '"screen -r devshell"')
+                    '"screen -r devshell %s"' % s_id)
 
 
 def prioritized():





More information about the Openembedded-commits mailing list