diff options
-rwxr-xr-x | script/autobuild.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/script/autobuild.py b/script/autobuild.py index cb3e9595bd..3fae59f255 100755 --- a/script/autobuild.py +++ b/script/autobuild.py @@ -273,6 +273,13 @@ def daemonize(logfile): os.dup2(0, 1) os.dup2(0, 2) +def write_pidfile(fname): + '''write a pid file, cleanup on exit''' + f = open(fname, mode='w') + f.write("%u\n" % os.getpid()) + f.close() + cleanup_list.append(fname) + def rebase_tree(url): print("Rebasing on %s" % url) @@ -435,6 +442,8 @@ if options.daemon: print "Forking into the background, writing progress to %s" % logfile daemonize(logfile) +write_pidfile(gitroot + "/autobuild.pid") + while True: try: run_cmd("rm -rf %s" % test_master) |