def stop(self):
try:<EOL><INDENT>with self.pidfile:<EOL><INDENT>self.log.error("<STR_LIT>")<EOL><DEDENT><DEDENT>except pidfile.PidFileError:<EOL><INDENT>with open(self.pidfile.filename) as fobj:<EOL><INDENT>pid = int(fobj.readline().rstrip())<EOL><DEDENT>if not pid:<EOL><INDENT>self.log.error("<STR_LIT>")<EOL><DEDENT>self.log.info("<STR_LIT>", pid)<EOL>os.kill(pid, signal.SIGTERM)<EOL><DEDENT>
stop daemon