mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-20 13:33:09 +00:00
#165: make 'tahoe restart --force' the default behavior: warn but do not stop if restart is used on something that wasn't a running node, and always try to start it afterwards. This is particularly important for #315 (restart -m), because otherwise a single not-already-running node will prevent all nodes from being restarted, resulting in longer downtime than necessary
This commit is contained in:
parent
51e3baeefc
commit
fdb0200eca
@ -23,9 +23,6 @@ class RestartOptions(BasedirMixin, usage.Options):
|
|||||||
["basedir", "C", None, "which directory to restart the node in"],
|
["basedir", "C", None, "which directory to restart the node in"],
|
||||||
]
|
]
|
||||||
optFlags = [
|
optFlags = [
|
||||||
["force", "f", "if the node is not already running, start it "
|
|
||||||
"instead of complaining that you should have used 'start' instead "
|
|
||||||
"of 'restart'"],
|
|
||||||
["profile", "p", "whether to run under the Python profiler, putting results in \"profiling_results.prof\""],
|
["profile", "p", "whether to run under the Python profiler, putting results in \"profiling_results.prof\""],
|
||||||
["syslog", None, "tell the node to log to syslog, not a file"],
|
["syslog", None, "tell the node to log to syslog, not a file"],
|
||||||
]
|
]
|
||||||
@ -178,7 +175,7 @@ def restart(config, stdout, stderr):
|
|||||||
rc = 0
|
rc = 0
|
||||||
for basedir in config['basedirs']:
|
for basedir in config['basedirs']:
|
||||||
rc = do_stop(basedir, stdout, stderr) or rc
|
rc = do_stop(basedir, stdout, stderr) or rc
|
||||||
if rc == 2 and config['force']:
|
if rc == 2:
|
||||||
print >>stderr, "ignoring couldn't-stop"
|
print >>stderr, "ignoring couldn't-stop"
|
||||||
rc = 0
|
rc = 0
|
||||||
if rc:
|
if rc:
|
||||||
|
Loading…
Reference in New Issue
Block a user