]> code.ossystems Code Review - openembedded-core.git/commitdiff
terminal.py: use unique ids for screen sessions
authorJason Wessel <jason.wessel@windriver.com>
Wed, 25 Jul 2012 17:47:28 +0000 (12:47 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sat, 25 Aug 2012 13:44:31 +0000 (14:44 +0100)
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@windriver.com>
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
meta/lib/oe/terminal.py

index 31317985f586c7cff28ef03246efd82a5a67443a..30e8f920041a9df8e64de88deea36ed431628e3e 100644 (file)
@@ -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():