%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python2.7/site-packages/salt/modules/
Upload File :
Create Path :
Current File : //lib/python2.7/site-packages/salt/modules/netbsdservice.pyo

�
���^c@@sdZddlmZmZmZddlZddlZddlZddlZidd6Z	dZ
d�Zd�Zd	�Z
d
�Zd�Zd�Zdd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�ZdS(u#
The service module for NetBSD

.. important::
    If you feel that Salt should be using this module to manage services on a
    minion, and it is using a different module (or gives an error similar to
    *'service.start' is not available*), see :ref:`here
    <module-provider-override>`.
i(tabsolute_importtprint_functiontunicode_literalsNureloadureload_uservicecC@s0tddkr&tjjd�r&tStdfS(u
    Only work on NetBSD
    uosuNetBSDu/etc/rc.subruLThe netbsdservice execution module failed to load: only available on NetBSD.(t
__grains__tostpathtexistst__virtualname__tFalse(((s>/usr/lib/python2.7/site-packages/salt/modules/netbsdservice.pyt__virtual__s"cC@sdj|�}td|�S(u�
    Start the specified service

    CLI Example:

    .. code-block:: bash

        salt '*' service.start <service name>
    u/etc/rc.d/{0} onestartucmd.retcode(tformatt__salt__(tnametcmd((s>/usr/lib/python2.7/site-packages/salt/modules/netbsdservice.pytstart$s
cC@sdj|�}td|�S(u~
    Stop the specified service

    CLI Example:

    .. code-block:: bash

        salt '*' service.stop <service name>
    u/etc/rc.d/{0} onestopucmd.retcode(R
R(RR
((s>/usr/lib/python2.7/site-packages/salt/modules/netbsdservice.pytstop2s
cC@sdj|�}td|�S(u�
    Restart the named service

    CLI Example:

    .. code-block:: bash

        salt '*' service.restart <service name>
    u/etc/rc.d/{0} onerestartucmd.retcode(R
R(RR
((s>/usr/lib/python2.7/site-packages/salt/modules/netbsdservice.pytrestart@s
cC@sdj|�}td|�S(u~
    Reload the named service

    CLI Example:

    .. code-block:: bash

        salt '*' service.reload <service name>
    u/etc/rc.d/{0} onereloaducmd.retcode(R
R(RR
((s>/usr/lib/python2.7/site-packages/salt/modules/netbsdservice.pytreload_Ns
cC@sdj|�}td|�S(u�
    Force-reload the named service

    CLI Example:

    .. code-block:: bash

        salt '*' service.force_reload <service name>
    u/etc/rc.d/{0} forcereloaducmd.retcode(R
R(RR
((s>/usr/lib/python2.7/site-packages/salt/modules/netbsdservice.pytforce_reload\s
cC@s�|rttd|��Sttjd|��}|rPtjt�|�}n	|g}i}x8|D]0}dj|�}td|dt�||<qfW|r�|S||S(u]
    Return the status for a service.
    If the name contains globbing, a dict mapping service name to True/False
    values is returned.

    .. versionchanged:: 2018.3.0
        The service name can now be a glob (e.g. ``salt*``)

    Args:
        name (str): The name of the service to check
        sig (str): Signature to use to find the service via ps

    Returns:
        bool: True if running, False otherwise
        dict: Maps service name to True if running, False otherwise

    CLI Example:

    .. code-block:: bash

        salt '*' service.status <service name> [service signature]
    u
status.pidu\*|\?|\[.+\]u/etc/rc.d/{0} onestatusucmd.retcodetignore_retcode(	tboolRtretsearchtfnmatchtfiltertget_allR
tTrue(Rtsigtcontains_globbingtservicestresultstserviceR
((s>/usr/lib/python2.7/site-packages/salt/modules/netbsdservice.pytstatusjs	
cC@s�d	}tddj|��j�}xf|D]^}|jd�r_dj|�|kr_d}q,|jd�r,|jdd�d}q,q,q,W|r�|r�|Sd	S(
u)
    Returns a unique service status
    ucmd.runu	{0} rcvaru$u={0}uyesu#u iN(tNoneRR
t
splitlinest
startswithtsplit(trcdtservice_statustenatlinestrcvartsvc((s>/usr/lib/python2.7/site-packages/salt/modules/netbsdservice.pyt_get_svc�s
$	cC@smd}t�}tjdj|��}x9|D]1}t||�}|dk	r.|j|�q.q.Wt|�S(u&
    Returns all service statuses
    u
/etc/rc.d/u{0}*N(tsettglobR
R+R!taddtsorted(R&tprefixtretR(tlineR*((s>/usr/lib/python2.7/site-packages/salt/modules/netbsdservice.pyt
_get_svc_list�s	
cC@s
td�S(u�
    Return a list of service that are enabled on boot

    CLI Example:

    .. code-block:: bash

        salt '*' service.get_enabled
    uYES(R3(((s>/usr/lib/python2.7/site-packages/salt/modules/netbsdservice.pytget_enabled�s
cC@s
td�S(u�
    Return a set of services that are installed but disabled

    CLI Example:

    .. code-block:: bash

        salt '*' service.get_disabled
    uNO(R3(((s>/usr/lib/python2.7/site-packages/salt/modules/netbsdservice.pytget_disabled�s
cC@s
|t�kS(u�
    Returns ``True`` if the specified service is available, otherwise returns
    ``False``.

    CLI Example:

    .. code-block:: bash

        salt '*' service.available sshd
    (R(R((s>/usr/lib/python2.7/site-packages/salt/modules/netbsdservice.pyt	available�scC@s
|t�kS(u�
    The inverse of service.available.
    Returns ``True`` if the specified service is not available, otherwise returns
    ``False``.

    CLI Example:

    .. code-block:: bash

        salt '*' service.missing sshd
    (R(R((s>/usr/lib/python2.7/site-packages/salt/modules/netbsdservice.pytmissing�scC@s
td�S(uz
    Return all available boot services

    CLI Example:

    .. code-block:: bash

        salt '*' service.get_all
    u(R3(((s>/usr/lib/python2.7/site-packages/salt/modules/netbsdservice.pyR�s
cC@s}d}dj|�}dj||�}tddj||��}|dkrftd|||�ntd||�}|S(	uz
    Modifies /etc/rc.conf so a service is started or not at boot time and
    can be started via /etc/rc.d/<service>
    u/etc/rc.confu^{0}=.*u{0}={1}ucmd.retcodeugrep '{0}' {1}iufile.replaceufile.append(R
R(RR&trcconftrxnamet	newstatusR1((s>/usr/lib/python2.7/site-packages/salt/modules/netbsdservice.pyt_rcconf_status�scK@s
t|d�S(u�
    Enable the named service to start at boot

    CLI Example:

    .. code-block:: bash

        salt '*' service.enable <service name>
    uYES(R;(Rtkwargs((s>/usr/lib/python2.7/site-packages/salt/modules/netbsdservice.pytenable	s
cK@s
t|d�S(u�
    Disable the named service to start at boot

    CLI Example:

    .. code-block:: bash

        salt '*' service.disable <service name>
    uNO(R;(RR<((s>/usr/lib/python2.7/site-packages/salt/modules/netbsdservice.pytdisables
cK@stdj|�d�S(u�
    Return True if the named service is enabled, false otherwise

    CLI Example:

    .. code-block:: bash

        salt '*' service.enabled <service name>
    u
/etc/rc.d/{0}uYES(R+R
(RR<((s>/usr/lib/python2.7/site-packages/salt/modules/netbsdservice.pytenabled#s
cC@stdj|�d�S(u�
    Return True if the named service is enabled, false otherwise

    CLI Example:

    .. code-block:: bash

        salt '*' service.disabled <service name>
    u
/etc/rc.d/{0}uNO(R+R
(R((s>/usr/lib/python2.7/site-packages/salt/modules/netbsdservice.pytdisabled0s
(t__doc__t
__future__RRRRR-RRt__func_alias__RR	RRRRRR!R R+R3R4R5R6R7RR;R=R>R?R@(((s>/usr/lib/python2.7/site-packages/salt/modules/netbsdservice.pyt<module>
s6
							(			
	
			
		
	
	

Zerion Mini Shell 1.0