def run(self, mysql_admin_props): p = mysql_admin_props self._check_admin_props(p) pid_file = p.pid_file_template % {"hostname": gethostname()} if not os.path.exists(pid_file): logger.debug("Mysql pid file %s not found, assuming db down" % pid_file) return False pid = int(procutils.sudo_cat_file(pid_file, self.ctx.logger, self.ctx._get_sudo_password(self))) result = procutils.is_process_alive(pid) if result: logger.debug("Mysql process %d is alive" % pid) return True else: logger.debug("Mysql process %d is not alive" % pid) return False