wait is on by default
This commit is contained in:
parent
c1884bbfdd
commit
6766bd371a
@ -29,8 +29,9 @@ def main():
|
||||
parser = OptionParser(USAGE)
|
||||
parser.add_option('-v', '--verbose', action="store_true",
|
||||
default=False, help="display verbose output")
|
||||
parser.add_option('-w', '--wait', action="store_true", default=False,
|
||||
help="wait for server to start before returning")
|
||||
parser.add_option('-w', '--no-wait', action="store_false", dest="wait",
|
||||
default=True, help="won't wait for server to start "
|
||||
"before returning")
|
||||
parser.add_option('-o', '--once', action="store_true",
|
||||
default=False, help="only run one pass of daemon")
|
||||
# this is a negative option, default is options.daemon = True
|
||||
|
@ -171,21 +171,21 @@ class Manager():
|
||||
print _('\nuser quit')
|
||||
self.stop(**kwargs)
|
||||
break
|
||||
elif kwargs.get('wait', False):
|
||||
elif kwargs.get('wait', True):
|
||||
for server in self.servers:
|
||||
status += server.wait(**kwargs)
|
||||
return status
|
||||
|
||||
@command
|
||||
def wait(self, **kwargs):
|
||||
"""spawn server and wait for it to start
|
||||
def no_wait(self, **kwargs):
|
||||
"""spawn server and return immediately
|
||||
"""
|
||||
kwargs['wait'] = True
|
||||
kwargs['wait'] = False
|
||||
return self.start(**kwargs)
|
||||
|
||||
@command
|
||||
def no_daemon(self, **kwargs):
|
||||
"""start a server interactivly
|
||||
"""start a server interactively
|
||||
"""
|
||||
kwargs['daemon'] = False
|
||||
return self.start(**kwargs)
|
||||
@ -485,7 +485,7 @@ class Server():
|
||||
print _("%s running (%s - %s)") % (self.server, pid, conf_file)
|
||||
return 0
|
||||
|
||||
def spawn(self, conf_file, once=False, wait=False, daemon=True, **kwargs):
|
||||
def spawn(self, conf_file, once=False, wait=True, daemon=True, **kwargs):
|
||||
"""Launch a subprocess for this server.
|
||||
|
||||
:param conf_file: path to conf_file to use as first arg
|
||||
@ -542,7 +542,7 @@ class Server():
|
||||
status = 0
|
||||
for proc in self.procs:
|
||||
# wait for process to terminate
|
||||
proc.communicate()[0]
|
||||
proc.communicate()
|
||||
if proc.returncode:
|
||||
status += 1
|
||||
return status
|
||||
|
Loading…
x
Reference in New Issue
Block a user