Show More
@@ -78,7 +78,8 b' def killdaemons(pidfile, tryhard=True, r' | |||
|
78 | 78 | logfn = lambda s: s |
|
79 | 79 | # Kill off any leftover daemon processes |
|
80 | 80 | try: |
|
81 | fp = open(pidfile) | |
|
81 | pids = [] | |
|
82 | with open(pidfile) as fp: | |
|
82 | 83 | for line in fp: |
|
83 | 84 | try: |
|
84 | 85 | pid = int(line) |
@@ -88,8 +89,9 b' def killdaemons(pidfile, tryhard=True, r' | |||
|
88 | 89 | logfn('# Not killing daemon process %s - invalid pid' |
|
89 | 90 | % line.rstrip()) |
|
90 | 91 | continue |
|
92 | pids.append(pid) | |
|
93 | for pid in pids: | |
|
91 | 94 | kill(pid, logfn, tryhard) |
|
92 | fp.close() | |
|
93 | 95 | if remove: |
|
94 | 96 | os.unlink(pidfile) |
|
95 | 97 | except IOError: |
General Comments 0
You need to be logged in to leave comments.
Login now