Enable the named service to start at boot

    CLI Example:

    .. code-block:: bash

        salt '*' service.enable <service name>
765590
def enable(name, **kwargs):
    '''
    
    '''
    osmajor = _osrel()[0]
    if osmajor < '6':
        cmd = 'update-rc.d -f {0} defaults 99'.format(_cmd_quote(name))
    else:
        cmd = 'update-rc.d {0} enable'.format(_cmd_quote(name))
    try:
        if int(osmajor) >= 6:
            cmd = 'insserv {0} && '.format(_cmd_quote(name)) + cmd
    except ValueError:
        osrel = _osrel()
        if osrel == 'testing/unstable' or osrel == 'unstable' or osrel.endswith("/sid"):
            cmd = 'insserv {0} && '.format(_cmd_quote(name)) + cmd
    return not __salt__['cmd.retcode'](cmd, python_shell=True)
718352
def get_disabled():
    '''
    
    '''
    ret = set()
    for name in _iter_service_names():
        if _service_is_upstart(name):
            if _upstart_is_disabled(name):
                ret.add(name)
        else:
            if _service_is_sysv(name):
                if _sysv_is_disabled(name):
                    ret.add(name)
    return sorted(ret)
1274013
def startup(name):
    '''
    
    '''
    ret = {'name': name,
           'changes': {},
           'result': None,
           'comment': ''}

    if __opts__['test']:
        ret['comment'] = 'Starting up local node'
        return ret

    __salt__['trafficserver.startup']()

    ret['result'] = True
    ret['comment'] = 'Starting up local node'
    return ret
261681
def _available(name, ret):
    '''
    
    '''
    avail = False
    if 'service.available' in __salt__:
        avail = __salt__['service.available'](name)
    elif 'service.get_all' in __salt__:
        avail = name in __salt__['service.get_all']()
    if not avail:
        ret['result'] = False
        ret['comment'] = 'The named service {0} is not available'.format(name)
    return avail
708662
def start(name):
    '''
    
    '''
    ret = {}
    cmd = '{0} startvm {1}'.format(vboxcmd(), name)
    ret = salt.modules.cmdmod.run(cmd).splitlines()
    return ret
520928
def restart(name):
    '''
    
    '''
    if _service_is_upstart(name):
        cmd = 'restart {0}'.format(name)
    else:
        cmd = '/sbin/service {0} restart'.format(name)
    return not __salt__['cmd.retcode'](cmd, python_shell=False)
605483
function begin(name, bypass) {
        _currentOperation = _getBase(name);
        if (bypass === true) {
            _currentOperation.bypass = true;
        }
    }
9058
def start(service_name, timeout: DEFAULT_TIMEOUT)
      Puppet.debug _("Starting the %{service_name} service. Timeout set to: %{timeout} seconds") % { service_name: service_name, timeout: timeout }

      valid_initial_states = [
        SERVICE_STOP_PENDING,
        SERVICE_STOPPED,
        SERVICE_START_PENDING
      ]

      transition_service_state(service_name, valid_initial_states, SERVICE_RUNNING, timeout) do |service|
        if StartServiceW(service, 0, FFI::Pointer::NULL) == FFI::WIN32_FALSE
          raise Puppet::Util::Windows::Error, _("Failed to start the service")
        end
      end

      Puppet.debug _("Successfully started the %{service_name} service") % { service_name: service_name }
    end
1217346
def on_service_add(self, service):
        
        self.launch_thread(service.name, self.check_loop, service)
122670
def reload_(name):
    '''
    
    '''
    if _service_is_upstart(name):
        cmd = 'reload {0}'.format(name)
    else:
        cmd = '/sbin/service {0} reload'.format(name)
    return not __salt__['cmd.retcode'](cmd, python_shell=False)
4046
def start(name, vmid=None, call=None):
    '''
    
    '''
    if call != 'action':
        raise SaltCloudSystemExit(
            'The start action must be called with -a or --action.'
        )

    log.debug('Start: %s (%s) = Start', name, vmid)
    if not set_vm_status('start', name, vmid=vmid):
        log.error('Unable to bring VM %s (%s) up..', name, vmid)
        raise SaltCloudExecutionFailure

    # xxx: TBD: Check here whether the status was actually changed to 'started'

    return {'Started': '{0} was started.'.format(name)}
544012
def enabled(name, root=None, **kwargs):  # pylint: disable=unused-argument
    '''
    
    '''
    # Try 'systemctl is-enabled' first, then look for a symlink created by
    # systemctl (older systemd releases did not support using is-enabled to
    # check templated services), and lastly check for a sysvinit service.
    if __salt__['cmd.retcode'](_systemctl_cmd('is-enabled', name, root=root),
                               python_shell=False,
                               ignore_retcode=True) == 0:
        return True
    elif '@' in name:
        # On older systemd releases, templated services could not be checked
        # with ``systemctl is-enabled``. As a fallback, look for the symlinks
        # created by systemctl when enabling templated services.
        local_config_path = _root(LOCAL_CONFIG_PATH, '/')
        cmd = ['find', local_config_path, '-name', name,
               '-type', 'l', '-print', '-quit']
        # If the find command returns any matches, there will be output and the
        # string will be non-empty.
        if bool(__salt__['cmd.run'](cmd, python_shell=False)):
            return True
    elif name in _get_sysv_services(root):
        return _sysv_enabled(name, root)

    return False
231250
def _start_services(self, console_env):
        """"""
        self._ad.services.register('sl4a', sl4a_service.Sl4aService)
        console_env['s'] = self._ad.services.sl4a
        console_env['sl4a'] = self._ad.sl4a
        console_env['ed'] = self._ad.ed
4587
def start(name, call=None):
    '''
    
    '''
    if call != 'action':
        raise SaltCloudSystemExit(
            'The start action must be called with -a or --action.'
        )

    log.info('Starting node %s', name)

    return vm_action(name, kwargs={'action': 'resume'}, call=call)
1367354
def start(name, call=None):
    '''
    
    '''
    if call != 'action':
        raise SaltCloudSystemExit(
            'The stop action must be called with -a or --action.'
        )

    log.info('Starting node %s', name)

    instanceId = _get_node(name)['InstanceId']

    params = {'Action': 'StartInstance',
              'InstanceId': instanceId}
    result = query(params)

    return result
778785
def restart_service(service):
    
    with settings(hide('running', 'stdout'), warn_only=True):
        log_yellow('stoping service %s' % service)
        sudo('service %s stop' % service)
        log_yellow('starting service %s' % service)
        sudo('service %s start' % service)
1030729
def enable(self, name=None):
        """"""
        if name is None:
            for name in self._actions_dict:
                self.enable(name)
            return
        self._actions_dict[name].qaction.setEnabled(True)