(self)
| 228 | return pid |
| 229 | |
| 230 | def quitInstance(self): |
| 231 | if os.name == "nt": |
| 232 | print "Not supported on windows." |
| 233 | return |
| 234 | |
| 235 | pid = self.isAlreadyRunning() |
| 236 | if not pid: |
| 237 | print "No pyLoad running." |
| 238 | return |
| 239 | |
| 240 | try: |
| 241 | os.kill(pid, 3) #SIGUIT |
| 242 | |
| 243 | t = time() |
| 244 | print "waiting for pyLoad to quit" |
| 245 | |
| 246 | while exists(self.pidfile) and t + 10 > time(): |
| 247 | sleep(0.25) |
| 248 | |
| 249 | if not exists(self.pidfile): |
| 250 | print "pyLoad successfully stopped" |
| 251 | else: |
| 252 | os.kill(pid, 9) #SIGKILL |
| 253 | print "pyLoad did not respond" |
| 254 | print "Kill signal was send to process with id %s" % pid |
| 255 | |
| 256 | except: |
| 257 | print "Error quitting pyLoad" |
| 258 | |
| 259 | |
| 260 | def cleanTree(self): |
no test coverage detected