added -f option for running stasher in foreground
reduced timeouts to 60secs
This commit is contained in:
@ -3668,6 +3668,8 @@ def usage(detailed=False, ret=0):
|
|||||||
print " for clients, default %s" % clientAddr
|
print " for clients, default %s" % clientAddr
|
||||||
print " -d, --datadir=dir - directory in which stasher files get written"
|
print " -d, --datadir=dir - directory in which stasher files get written"
|
||||||
print " default is ~/.i2pstasher"
|
print " default is ~/.i2pstasher"
|
||||||
|
print " -f, --foreground - only valid for 'start' cmd - runs the node"
|
||||||
|
print " in foreground without spawning - for debugging"
|
||||||
print
|
print
|
||||||
print "Commands:"
|
print "Commands:"
|
||||||
print " start [<nodename>]"
|
print " start [<nodename>]"
|
||||||
@ -3714,9 +3716,9 @@ def main():
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
opts, args = getopt.getopt(sys.argv[1:],
|
opts, args = getopt.getopt(sys.argv[1:],
|
||||||
"h?vV:S:C:sd:",
|
"h?vV:S:C:sd:f",
|
||||||
['help', 'version', 'samaddr=', 'clientaddr=',
|
['help', 'version', 'samaddr=', 'clientaddr=',
|
||||||
'verbosity=', 'status', 'datadir=',
|
'verbosity=', 'status', 'datadir=', 'foreground',
|
||||||
])
|
])
|
||||||
except:
|
except:
|
||||||
traceback.print_exc(file=sys.stdout)
|
traceback.print_exc(file=sys.stdout)
|
||||||
@ -3725,6 +3727,7 @@ def main():
|
|||||||
daemonise = True
|
daemonise = True
|
||||||
verbosity = 2
|
verbosity = 2
|
||||||
debug = False
|
debug = False
|
||||||
|
foreground = False
|
||||||
|
|
||||||
for opt, val in opts:
|
for opt, val in opts:
|
||||||
|
|
||||||
@ -3738,6 +3741,9 @@ def main():
|
|||||||
elif opt in ['-V', '--verbosity']:
|
elif opt in ['-V', '--verbosity']:
|
||||||
logVerbosity = int(val)
|
logVerbosity = int(val)
|
||||||
|
|
||||||
|
elif opt in ['-f', '--foreground']:
|
||||||
|
foreground = True
|
||||||
|
|
||||||
elif opt in ['-S', '--samaddr']:
|
elif opt in ['-S', '--samaddr']:
|
||||||
samAddr = val
|
samAddr = val
|
||||||
|
|
||||||
@ -3773,6 +3779,10 @@ def main():
|
|||||||
if cmd == 'help':
|
if cmd == 'help':
|
||||||
usage()
|
usage()
|
||||||
|
|
||||||
|
# dirty hack
|
||||||
|
if foreground and cmd == 'start':
|
||||||
|
cmd = '_start'
|
||||||
|
|
||||||
# magic undocumented command name - starts node, launches its client server,
|
# magic undocumented command name - starts node, launches its client server,
|
||||||
# this should only happen if we're spawned from a 'start' command
|
# this should only happen if we're spawned from a 'start' command
|
||||||
if cmd == '_start':
|
if cmd == '_start':
|
||||||
|
Reference in New Issue
Block a user