From 8c5b1dbba571456e3b68bcf25e4ca9db9b7b669b Mon Sep 17 00:00:00 2001 From: Magnus Ahltorp Date: Tue, 31 Mar 2015 19:35:13 +0200 Subject: Wait 0.5 seconds after writing halt command --- tools/halt.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'tools') diff --git a/tools/halt.py b/tools/halt.py index cfbf14e..0cb43ed 100755 --- a/tools/halt.py +++ b/tools/halt.py @@ -7,6 +7,7 @@ import argparse import subprocess import sys +import select parser = argparse.ArgumentParser(description='') parser.add_argument('toerl') @@ -16,4 +17,8 @@ args = parser.parse_args() p = subprocess.Popen( [args.toerl, args.nodedir], stdin=subprocess.PIPE) -p.communicate("halt().\n") +p.stdin.write("halt().\n") +p.stdin.flush() +select.select([], [], [], 0.5) +p.stdin.close() +p.wait() -- cgit v1.1