def delete(self, force=defaults.DAEMON_FORCE_DELETE): if self._is_daemon_running(): if not force: raise exceptions.DaemonStillRunningException(self.name) self.stop() self._logger.info('Removing {0} service'.format(self.name)) self._runner.run('{0} remove {1} confirm'.format( self.nssm_path, self.name)) self._logger.debug('Deleting {0}'.format(self.config_path)) if os.path.exists(self.config_path): os.remove(self.config_path)
def delete(self, force=defaults.DAEMON_FORCE_DELETE): if self._is_daemon_running(): if not force: raise exceptions.DaemonStillRunningException(self.name) self.stop() self._delete() if os.path.exists(self.script_path): self._logger.debug('Deleting {0}'.format(self.script_path)) self._runner.run('sudo rm {0}'.format(self.script_path)) if os.path.exists(self.config_path): self._logger.debug('Deleting {0}'.format(self.config_path)) self._runner.run('sudo rm {0}'.format(self.config_path))
def delete(self, force=defaults.DAEMON_FORCE_DELETE): if self._is_agent_registered(): if not force: raise exceptions.DaemonStillRunningException(self.name) self.stop() if os.path.exists(self.pid_file): self._logger.debug('Removing {0}'.format(self.pid_file)) os.remove(self.pid_file) if os.path.exists(self.config_path): self._logger.debug('Removing {0}'.format(self.config_path)) os.remove(self.config_path) if os.path.exists(self.script_path): self._logger.debug('Removing {0}'.format(self.script_path)) os.remove(self.script_path)
def delete(self, force=defaults.DAEMON_FORCE_DELETE): if self._is_agent_registered(): if not force: raise exceptions.DaemonStillRunningException(self.name) self.stop() if self.start_on_boot: self._logger.info('Deleting start-on-boot entry') self._start_on_boot_handler.delete() if os.path.exists(self.script_path): self._logger.debug('Deleting {0}'.format(self.script_path)) self._runner.run('sudo rm {0}'.format(self.script_path)) if os.path.exists(self.config_path): self._logger.debug('Deleting {0}'.format(self.config_path)) self._runner.run('sudo rm {0}'.format(self.config_path))