]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
run: put pid in archive dir
authorSage Weil <sage@newdream.net>
Sun, 8 Jan 2012 22:39:30 +0000 (14:39 -0800)
committerSage Weil <sage@newdream.net>
Sun, 8 Jan 2012 22:39:30 +0000 (14:39 -0800)
This will make it easy for teuthology-ls to show you the running process's
pid (if it's still running).  Or for other utiltizes to kill + clean up
a hung teuthology run.

teuthology/run.py

index 21d21e6dc6f87a6eb2180c70251ba21c4019ce70..13ec63165a6c9b87d6eb6a6fc78920ff060eb49f 100644 (file)
@@ -102,6 +102,9 @@ def main():
         handler.setFormatter(formatter)
         logging.getLogger().addHandler(handler)
 
+        with file(os.path.join(ctx.archive, 'pid'), 'w') as f:
+            f.write('%d' % os.getpid())
+
     log.debug('\n  '.join(['Config:', ] + yaml.safe_dump(ctx.config, default_flow_style=False).splitlines()))
 
     ctx.summary = dict(success=True)