def start(self):
try:<EOL><INDENT>pid = self.get_pid_from_file()<EOL><DEDENT>except PIDFileError:<EOL><INDENT>self.log.critical(<EOL>'<STR_LIT>'<EOL>)<EOL>self.remove_pid_file()<EOL>self.exit(ALREADY_STOPPED)<EOL><DEDENT>if not self.check_pid(pid):<EOL><INDENT>self.log.critical(<EOL>'<STR_LIT>' % pid<EOL>)<EOL>self.remove_pid_file()<EOL>self.exit(ALREADY_STOPPED)<EOL><DEDENT>elif os.name=='<STR_LIT>':<EOL><INDENT>sig = self.signal<EOL>self.log.info(<EOL>"<STR_LIT>" % (pid, sig)<EOL>)<EOL>try:<EOL><INDENT>os.kill(pid, sig)<EOL><DEDENT>except OSError:<EOL><INDENT>self.log.error("<STR_LIT>",<EOL>exc_info=True)<EOL>self.remove_pid_file()<EOL><DEDENT><DEDENT>elif os.name=='<STR_LIT>':<EOL><INDENT>try:<EOL><INDENT>p = check_call(['<STR_LIT>', '<STR_LIT>', str(pid), '<STR_LIT>', '<STR_LIT>'], stdout=PIPE,stderr=PIPE)<EOL><DEDENT>except (CalledProcessError, OSError):<EOL><INDENT>self.log.error("<STR_LIT>",<EOL>exc_info=True)<EOL><DEDENT>self.remove_pid_file()<EOL><DEDENT>
Start the app for the stop subcommand.