Split stdout and stderr for monitor_queue into separate files,
and make the log files unbuffered so we can actually see what's going on

Signed-off-by: Martin J. Bligh <mbligh@google.com>



git-svn-id: http://test.kernel.org/svn/autotest/trunk@750 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/scheduler/monitor_queue b/scheduler/monitor_queue
index 562ac3f..700c4e3 100755
--- a/scheduler/monitor_queue
+++ b/scheduler/monitor_queue
@@ -130,11 +130,14 @@
 	print "Starting job: %s" % control
 	print autoserv_cmd
 	
-	autoserv_log = open(os.path.join(debug, 'server.log'), 'w', 0)
-	p = Popen(autoserv_cmd, shell=True, stdout=autoserv_log, stderr=STDOUT,
-								cwd=results)
+	open(os.path.join(debug, 'autoserv.cmd'), 'w', 0).write(autoserv_cmd + '\n')
+	autoserv_stdout = open(os.path.join(debug, 'autoserv.stdout'), 'w', 0)
+	autoserv_stderr = open(os.path.join(debug, 'autoserv.stderr'), 'w', 0)
+	p = Popen(autoserv_cmd, shell=True, stdout=autoserv_stdout,
+					    stderr=autoserv_stderr, cwd=results)
 	(pid, ret) = os.waitpid(p.pid, 0)
-	autoserv_log.close()
+	autoserv_stdout.close()
+	autoserv_stderr.close()
 	
 	# If this was a tempfile then clean it up
 	if not is_autoserv_ctl: