Enable the named service to start at boot.

    flags : None
        Set optional flags to run the service with.

    service.flags can be used to change the default flags.

    CLI Example:

    .. code-block:: bash

        salt '*' service.enable <service name>
        salt '*' service.enable <service name> flags=<flags>

def enable(name, **kwargs):
    '''
    Enable the named service to start at boot.

    flags : None
        Set optional flags to run the service with.

    service.flags can be used to change the default flags.

    CLI Example:

    .. code-block:: bash

        salt '*' service.enable <service name>
        salt '*' service.enable <service name> flags=<flags>
    '''
    stat_cmd = '{0} set {1} status on'.format(_cmd(), name)
    stat_retcode = __salt__['cmd.retcode'](stat_cmd)

    flag_retcode = None
    # only (re)set flags for services that have an rc.d(8) script
    if os.path.exists('/etc/rc.d/{0}'.format(name)):
        flags = _get_flags(**kwargs)
        flag_cmd = '{0} set {1} flags {2}'.format(_cmd(), name, flags)
        flag_retcode = __salt__['cmd.retcode'](flag_cmd)

    return not any([stat_retcode, flag_retcode])