mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-04-13 13:53:07 +00:00
If do_stop attempts to stop a nonexistent process the OSError exception is caught (by errno) and handled tersely.
This commit is contained in:
parent
39f218ab90
commit
e13783cd6a
@ -91,7 +91,14 @@ def do_stop(basedir, config, out=sys.stdout, err=sys.stderr):
|
||||
pid = int(pid)
|
||||
|
||||
timer = 0
|
||||
os.kill(pid, signal.SIGTERM)
|
||||
try:
|
||||
os.kill(pid, signal.SIGTERM)
|
||||
except OSError, oserr:
|
||||
if oserr.errno == 3:
|
||||
print oserr.strerror
|
||||
return 1
|
||||
else:
|
||||
raise
|
||||
time.sleep(0.1)
|
||||
while timer < 5:
|
||||
# poll once per second until twistd.pid goes away, up to 5 seconds
|
||||
|
Loading…
x
Reference in New Issue
Block a user