Reworked interactive mode, on the way to fixing #803.

This commit is contained in:
Griatch 2015-09-07 23:39:53 +02:00
parent a9480f9f64
commit f1834dc194
2 changed files with 10 additions and 2 deletions

View file

@ -1034,8 +1034,13 @@ def server_operation(mode, service, interactive, profiler):
PORTAL_LOGFILE, HTTP_LOGFILE])
# start the server
process = Popen(cmdstr, env=getenv())
if interactive:
process.wait()
try:
process.wait()
except KeyboardInterrupt:
print "\nKeyboard interrupt sent in interactive mode.\n"
elif mode == 'reload':
# restarting services

View file

@ -184,7 +184,10 @@ def start_services(server_argv, portal_argv):
while True:
# this blocks until something is actually returned.
message, rc = processes.get()
try:
message, rc = processes.get()
except KeyboardInterrupt:
break
# restart only if process stopped cleanly
if (message == "server_stopped" and int(rc) == 0 and