Delete an upstart service. This will only rename the .conf file
492759
def _upstart_delete(name):
    '''
    
    '''
    if HAS_UPSTART:
        if os.path.exists('/etc/init/{0}.conf'.format(name)):
            os.rename('/etc/init/{0}.conf'.format(name),
                      '/etc/init/{0}.conf.removed'.format(name))
    return True
307584
def clean_conf_folder(self, locale):
        """"""
        dirname = self.configuration.get_messages_dir(locale)
        dirname.removedirs_p()
96460
def remove_service(self, zconf, typ, name):
        
        _LOGGER.debug("remove_service %s, %s", typ, name)
        service = self.services.pop(name, None)

        if not service:
            _LOGGER.debug("remove_service unknown %s, %s", typ, name)
            return

        if self.remove_callback:
            self.remove_callback(name, service)
1312983
def uninstall(ctx, yes, services):
    """"""
    logger.debug("running command %s (%s)", ctx.command.name, ctx.params,
                 extra={"command": ctx.command.name, "params": ctx.params})

    home = ctx.obj["HOME"]

    for service in services:
        service_path = plugin_utils.get_plugin_path(home, SERVICES, service)
        plugin_utils.uninstall_plugin(service_path, yes)
409339
def unregister(self, alias):
        
        if alias not in self._service_objects:
            raise Error(self._device,
                        'No service is registered with alias "%s".' % alias)
        service_obj = self._service_objects.pop(alias)
        if service_obj.is_alive:
            with expects.expect_no_raises(
                    'Failed to stop service instance "%s".' % alias):
                service_obj.stop()
584226
def _delete_iapp(self, iapp_name, deploying_device):
        '''
        '''

        iapp = deploying_device.tm.sys.application
        iapp_serv = iapp.services.service.load(
            name=iapp_name, partition=self.partition
        )
        iapp_serv.delete()
        iapp_tmpl = iapp.templates.template.load(
            name=iapp_name, partition=self.partition
        )
        iapp_tmpl.delete()
735541
function cleanUpPreviousConfig(location, app, callback) {
  var confRegex = new RegExp(app + ".*\\.conf");
  var removeConfig = function(fileName, rmCallback) {
    if (confRegex.test(fileName)) {
      return fs.unlink(location + '/' + fileName, rmCallback);
    } else {
      return rmCallback(null);
    }
  };

  fs.readdir(location, function(err, files) {
    async.forEach(files, removeConfig, callback);
  });
}
789307
def _delete_service(self, service_only=False):
        
        logging.debug('_delete_service()')
        return self.service.delete_service(self.service_name)
968582
def clean(self):
        
        to_del = []
        for serv in self:
            if not serv.host:
                to_del.append(serv.uuid)
        for service_uuid in to_del:
            del self.items[service_uuid]
961599
def discard_config(self):
        """"""
        if self.config_session is not None:
            commands = []
            commands.append('configure session {}'.format(self.config_session))
            commands.append('abort')
            self.device.run_commands(commands)
            self.config_session = None
278108
function remove(conf) {
  var file = conf.get(ConfigKey.PIDFILE);
  // can be the empty string
  if(file) {
    log.notice('removing pid file %s', file);
    try {
      fs.unlinkSync(file);
    }catch(e) {
      log.warning('failed to remove pid file (%s): %s', file, e.message);
    }
  }
}
594045
def delete_config_dir
      begin
        FileUtils.rm_r(config_dir) if dir_exists?

      rescue StandardError => e
        raise FileAccessError, e.message
      end
    end
1300351
def delete(self, opts):
        """"""

        argv = opts.args
        count = len(argv)

        # unflagged arguments are conf, stanza, key. In this order
        # however, we must have a conf and stanza.
        cpres = True if count > 0 else False
        spres = True if count > 1 else False
        kpres = True if count > 2 else False 
        
        if not cpres:
            error("Conf name is required for delete", 2)

        if not cpres and not spres:
            error("Conf name and stanza name is required for delete", 2)

        if kpres:
            error("Cannot delete individual keys from a stanza", 2)

        name = argv[0]
        stan = argv[1]
        conf = self.service.confs[name]
        conf.delete(stan)
317465
def delete(self):
        
        cmd = self.command_builder('ntp source', disable=True)
        return self.configure(cmd)
406740
def delete_password(self, service, username):
        
        service = escape_for_ini(service)
        username = escape_for_ini(username)
        config = configparser.RawConfigParser()
        if os.path.exists(self.file_path):
            config.read(self.file_path)
        try:
            if not config.remove_option(service, username):
                raise PasswordDeleteError("Password not found")
        except configparser.NoSectionError:
            raise PasswordDeleteError("Password not found")
        # update the file
        with open(self.file_path, 'w') as config_file:
            config.write(config_file)
729676
def teardown_databases(self, old_config, options):
        
        if len(old_config) > 1:
            old_names, mirrors = old_config
        else:
            old_names = old_config
        for connection, old_name, destroy in old_names:
            if destroy:
                connection.creation.destroy_test_db(old_name, options['verbosity'])
94040
def disabled(name):
    '''
    
    '''
    if _service_is_upstart(name):
        return _upstart_is_disabled(name)
    else:
        if _service_is_sysv(name):
            return _sysv_is_disabled(name)
    return None