%PDF- %PDF-
Mini Shell

Mini Shell

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

�
���^c@@s�dZddlmZmZmZddlZddlZddlZddlZddl	Z
ddlZ
ddlm
Z
y:ddlZddlZddlZddlZeZWnek
r�eZnXeje�ZdZi
dd6dd	6d
d6dd
6dd6dd6dd6dd6d	d6dd6d
d6dd6dd6Zidd6dd	6dd6dd
6dd6dd6d d!6d"d#6d$d6d%d&6d'd(6Zid)d6d*d	6d+d,6d-d6d.d/6d0d16d2d36Zid4d6d5d66Zi
dd76dd86d	d96d,d:6dd;6d<d6d=d6d>d	6d?d,6d@d6ZidAd6dBd6dCd	6dDd,6ddE6ddF6d	dG6d,dH6ZdI�Z dJ�Z!dK�Z"dL�Z#dM�Z$dN�Z%dO�Z&dP�Z'dQ�Z(dR�Z)dS�Z*dTdU�Z+dTdV�Z,dTdW�Z-dX�Z.dY�Z/dZ�Z0d[�Z1dddddddddddddd\�
Z3d9ed]�Z4d^�Z5d_�Z6d`�Z7ddddd:edFdddadedb�Z8dTdc�Z9dS(duS
Windows Service module.

.. versionchanged:: 2016.11.0 - Rewritten to use PyWin32
i(tabsolute_importtunicode_literalstprint_functionN(tCommandExecutionErroruserviceu
Kernel DriveriuFile System DriveriuAdapter DriveriuRecognizer DriveriuWin32 Own ProcessiuWin32 Share Processi uInteractiveiukernelu
filesystemuadapteru
recognizeruownushareuStopuPause/ContinueuShutdownuChange ParametersuNetbind ChangeuHardware Profile ChangeuPower Eventi@uSession Changei�uPre-ShutdownuTime Changeiu
Trigger EventiuStoppedu
Start PendinguStop PendingiuRunninguContinue Pendingiu
Pause PendingiuPausediuNo ErroruService Specific Errori*ubootusystemuautoumanualudisableduBootuSystemuAutouManualuDisableduIgnoreuNormaluSevereuCriticaluignoreunormalusevereucriticalcC@s0tjjj�stdfSts,tdfStS(u>
    Only works on Windows systems with PyWin32 installed
    u1Module win_service: module only works on Windows.u0Module win_service: failed to load win32 modules(tsalttutilstplatformt
is_windowstFalsetHAS_WIN32_MODSt__virtualname__(((s</usr/lib/python2.7/site-packages/salt/modules/win_service.pyt__virtual__]s


cC@s�t|�}x�|d|kr�tj�|kr�|d}|rK|dnd}|dkrfd}n|dkr{d}ntj|�t|�}qW|S(uW
    Helper function that will wait for the status of the service to match the
    provided status before an end time expires. Used for service stop and start

    .. versionadded:: 2017.7.9,2018.3.4

    Args:
        service_name (str):
            The name of the service

        end_time (float):
            A future time. e.g. time.time() + 10

        service_states (list):
            Services statuses to wait for as returned by info()

    Returns:
        dict: A dictionary containing information about the service.

    :codeauthor: Damon Atkins <https://github.com/damon-atkins>
    uStatusuStatus_WaitHinti�iii
(tinfottimetsleep(tservice_nametend_timetservice_statestinfo_resultst	wait_time((s</usr/lib/python2.7/site-packages/salt/modules/win_service.pyt_status_waitjs%
		
cC@sVtjd�}x1|j|�dk	rB|jd�jd�}qWdj|�}|S(uP
    Helper function to properly format the path to the binary for the service
    Must be wrapped in double quotes to account for paths that have spaces. For
    example:

    ``"C:\Program Files\Path\to\bin.exe"``

    Args:
        cmd (str): Full path to the binary

    Returns:
        str: Properly quoted path to the binary
    u^(\"|').*|.*(\"|')$u"u'u"{0}"N(tretcompiletmatchtNonetstriptformat(tcmdtpattern((s</usr/lib/python2.7/site-packages/salt/modules/win_service.pyt
_cmd_quote�s
cC@s[t�}t�}x<|D]4}t|d�ddkr|j|d�qqWt|�S(u�
    Return a list of enabled services. Enabled is defined as a service that is
    marked to Auto Start.

    Returns:
        list: A list of enabled services

    CLI Example:

    .. code-block:: bash

        salt '*' service.get_enabled
    uServiceNameu	StartTypeuAuto(uAuto(t
_get_servicestsetRtaddtsorted(traw_servicestservicestservice((s</usr/lib/python2.7/site-packages/salt/modules/win_service.pytget_enabled�s		
cC@s[t�}t�}x<|D]4}t|d�ddkr|j|d�qqWt|�S(u
    Return a list of disabled services. Disabled is defined as a service that is
    marked 'Disabled' or 'Manual'.

    Returns:
        list: A list of disabled services.

    CLI Example:

    .. code-block:: bash

        salt '*' service.get_disabled
    uServiceNameu	StartTypeuManualuDisabled(uManualuDisabled(RRRR R!(R"R#R$((s</usr/lib/python2.7/site-packages/salt/modules/win_service.pytget_disabled�s		
cC@s4x-t�D]"}|j�|j�kr
tSq
WtS(u-
    Check if a service is available on the system.

    Args:
        name (str): The name of the service to check

    Returns:
        bool: ``True`` if the service is available, ``False`` otherwise

    CLI Example:

    .. code-block:: bash

        salt '*' service.available <service name>
    (tget_alltlowertTrueR(tnameR$((s</usr/lib/python2.7/site-packages/salt/modules/win_service.pyt	available�scC@s
|t�kS(u
    The inverse of service.available.

    Args:
        name (str): The name of the service to check

    Returns:
        bool: ``True`` if the service is missing, ``False`` otherwise

    CLI Example:

    .. code-block:: bash

        salt '*' service.missing <service name>
    (R'(R*((s</usr/lib/python2.7/site-packages/salt/modules/win_service.pytmissing�scC@sgtjddtj�}z:ytj|�}Wn tk
rPtj|�}nXWdtj|�X|S(u7
    Returns a list of all services on the system.
    N(twin32servicet
OpenSCManagerRtSC_MANAGER_ENUMERATE_SERVICEtEnumServicesStatusExtAttributeErrortEnumServicesStatustCloseServiceHandle(t
handle_scmR#((s</usr/lib/python2.7/site-packages/salt/modules/win_service.pyRs
cC@s>t�}t�}x|D]}|j|d�qWt|�S(u�
    Return all installed services

    Returns:
        list: Returns a list of all services on the system.

    CLI Example:

    .. code-block:: bash

        salt '*' service.get_all
    uServiceName(RRR R!(R#tretR$((s</usr/lib/python2.7/site-packages/salt/modules/win_service.pyR's

		
cG@s�t�}t�}xt|D]l}|rs|d|ks[|d|ks[|dj�|kr�|d||d<q�q|d||d<qW|S(uG
    The Display Name is what is displayed in Windows when services.msc is
    executed.  Each Display Name has an associated Service Name which is the
    actual name of the service.  This function allows you to discover the
    Service Name by returning a dictionary of Display Names and Service Names,
    or filter by adding arguments of Display Names.

    If no args are passed, return a dict of all services where the keys are the
    service Display Names and the values are the Service Names.

    If arguments are passed, create a dict of Display Names and Service Names

    Returns:
        dict: A dictionary of display names and service names

    CLI Examples:

    .. code-block:: bash

        salt '*' service.get_service_name
        salt '*' service.get_service_name 'Google Update Service (gupdate)' 'DHCP Client'
    uDisplayNameuServiceName(RtdictR((targsR"R#traw_service((s</usr/lib/python2.7/site-packages/salt/modules/win_service.pytget_service_name.s		
cC@s�ytjddtj�}Wn.tjk
rL}tdj|j���nXy1tj	||tj
tjBtjBtj
B�}Wn1tjk
r�}tdj||j���nXzmtj|�}tj|�}ytj|tj�}Wntjk
rd}nXtj|tj�}Wdtj|�tj|�Xt�}y6tjddj|��d}	tj|	�|d<Wntjk
r�d	|d<nX|d
|d<|d|d
<|d|d<|d|d<|d|d<|d|d<||d<|d|d<|d|d<|d|d<||d<t�}
xBtD]:}t|t�r?|d|@ry|
jt|�qyq?q?W|
r�|
n|d|d<t�}
x0tD](}|d|@r�|
jt|�q�q�W|
r�|
n|d|d<yt|d |d!<Wntk
r$|d |d!<nXyt |d"|d#<Wntk
r\|d"|d#<nXyt!|d$|d%<Wntk
r�|d$|d%<nXyt"|d&|d'<Wntk
r�|d&|d'<nX|S((ur
    Get information about a service on the system

    Args:
        name (str): The name of the service. This is not the display name. Use
            ``get_service_name`` to find the service name.

    Returns:
        dict: A dictionary containing information about the service.

    CLI Example:

    .. code-block:: bash

        salt '*' service.info spooler
    u!Failed to connect to the SCM: {0}uFailed To Open {0}: {1}uFailed to get descriptionNuuNT Service\{0}iusiduFailed to get SIDiu
BinaryPathiuLoadOrderGroupiuTagIDiuDependenciesiuServiceAccountiuDisplayNameuDescriptionuServiceSpecificExitCodeuStatus_ServiceCodeu
CheckPointuStatus_CheckPointuWaitHintuStatus_WaitHintuStartTypeDelayeduServiceTypeuControlsAcceptedu
Win32ExitCodeuStatus_ExitCodeiu	StartTypeiuErrorControluCurrentStateuStatus(#R-R.RtSC_MANAGER_CONNECTt
pywintypesterrorRRtstrerrortOpenServicetSERVICE_ENUMERATE_DEPENDENTStSERVICE_INTERROGATEtSERVICE_QUERY_CONFIGtSERVICE_QUERY_STATUStQueryServiceConfigtQueryServiceStatusExtQueryServiceConfig2tSERVICE_CONFIG_DESCRIPTIONt&SERVICE_CONFIG_DELAYED_AUTO_START_INFOR3R6t
win32securitytLookupAccountNametConvertSidToStringSidtlisttSERVICE_TYPEt
isinstancetinttappendtSERVICE_CONTROLStSERVICE_ERRORStKeyErrortSERVICE_START_TYPEtSERVICE_ERROR_CONTROLt
SERVICE_STATE(R*R4texct
handle_svctconfig_infotstatus_infotdescriptiont
delayed_startR5tsidtflagstbit((s</usr/lib/python2.7/site-packages/salt/modules/win_service.pyRTs�

	

	
	




iZcC@s�t|�rt|dd�nytj|�WnYtjk
r�}|jdkrrtdj||j	���nt
jdj|��nXtd|dt
j
�t|�dd	d
g�}|ddkS(
u�
    Start the specified service.

    .. warning::
        You cannot start a disabled service in Windows. If the service is
        disabled, it will be changed to ``Manual`` start.

    Args:
        name (str): The name of the service to start

        timeout (int):
            The time in seconds to wait for the service to start before
            returning. Default is 90 seconds

            .. versionadded:: 2017.7.9,2018.3.4

    Returns:
        bool: ``True`` if successful, otherwise ``False``. Also returns ``True``
            if the service is already started

    CLI Example:

    .. code-block:: bash

        salt '*' service.start <service name>
    t
start_typeuManuali uFailed To Start {0}: {1}uService "{0}" is runningRRRu
Start PendinguStoppeduStatusuRunning(tdisabledtmodifytwin32serviceutiltStartServiceR;R<twinerrorRRR=tlogtdebugRR
RN(R*ttimeoutRVt
srv_status((s</usr/lib/python2.7/site-packages/salt/modules/win_service.pytstart�scC@s�ytj|�WnYtjk
rl}|jdkrStdj||j���ntj	dj|��nXt
d|dtj�t|�dddg�}|d	d
kS(u
    Stop the specified service

    Args:
        name (str): The name of the service to stop

        timeout (int):
            The time in seconds to wait for the service to stop before
            returning. Default is 90 seconds

            .. versionadded:: 2017.7.9,2018.3.4

    Returns:
        bool: ``True`` if successful, otherwise ``False``. Also returns ``True``
            if the service is already stopped

    CLI Example:

    .. code-block:: bash

        salt '*' service.stop <service name>
    i&uFailed To Stop {0}: {1}uService "{0}" is not runningRRRuRunninguStop PendinguStatusuStopped(
RbtStopServiceR;R<RdRRR=ReRfRR
RN(R*RgRVRh((s</usr/lib/python2.7/site-packages/salt/modules/win_service.pytstop�scC@sBd|krt�t�Std|d|�oAtd|d|�S(u�
    Restart the named service. This issues a stop command followed by a start.

    Args:
        name: The name of the service to restart.

            .. note::
                If the name passed is ``salt-minion`` a scheduled task is
                created and executed to restart the salt-minion service.

        timeout (int):
            The time in seconds to wait for the service to stop and start before
            returning. Default is 90 seconds

            .. note::
                The timeout is cumulative meaning it is applied to the stop and
                then to the start command. A timeout of 90 could take up to 180
                seconds if the service is long in stopping and starting

            .. versionadded:: 2017.7.9,2018.3.4

    Returns:
        bool: ``True`` if successful, otherwise ``False``

    CLI Example:

    .. code-block:: bash

        salt '*' service.restart <service name>
    usalt-minionR*Rg(tcreate_win_salt_restart_tasktexecute_salt_restart_taskRkRi(R*Rg((s</usr/lib/python2.7/site-packages/salt/modules/win_service.pytrestarts
cC@s\tjjjd�}d}tddddddtd	d
d|d|d
ddddd�	S(u
    Create a task in Windows task scheduler to enable restarting the salt-minion

    Returns:
        bool: ``True`` if successful, otherwise ``False``

    CLI Example:

    .. code-block:: bash

        salt '*' service.create_win_salt_restart_task()
    ucmduG/c ping -n 3 127.0.0.1 && net stop salt-minion && net start salt-minionutask.create_taskR*urestart-salt-miniont	user_nameuSystemtforcetaction_typeuExecuteRt	argumentsttrigger_typeuOncet
start_dateu
1975-01-01t
start_timeu01:00(RRtpathtwhicht__salt__R)(RR7((s</usr/lib/python2.7/site-packages/salt/modules/win_service.pyRl<scC@stddd�S(u�
    Run the Windows Salt restart task

    Returns:
        bool: ``True`` if successful, otherwise ``False``

    CLI Example:

    .. code-block:: bash

        salt '*' service.execute_salt_restart_task()
    utask.runR*urestart-salt-minion(Rx(((s</usr/lib/python2.7/site-packages/salt/modules/win_service.pyRmXs
cO@s�i}t�}ttjd|��}|rBtj||�}n	|g}x(|D] }t|�ddk||<qRW|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

    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>
    u\*|\?|\[.+\]uStatusuRunninguStop Pending(uRunninguStop Pending(R'tboolRtsearchtfnmatchtfilterR(R*R7tkwargstresultstall_servicestcontains_globbingR#R$((s</usr/lib/python2.7/site-packages/salt/modules/win_service.pytstatushs		
cC@st|�dS(u)
    Return the SID for this windows service

    Args:
        name (str): The name of the service for which to return the SID

    Returns:
        str: A string representing the SID for the service

    CLI Example:

    .. code-block:: bash

        salt '*' service.getsid <service name>
    usid(R(R*((s</usr/lib/python2.7/site-packages/salt/modules/win_service.pytgetsid�scC@stjddtj�}y#tj||tjtjB�}Wn1tjk
rn}t	dj
||j���nXtj|�}t
�}|dk	r�t|�}|dk	r�dj
||�}n||d<n|dk	r,|j�tkrt|j�}|
r)|tjB}q)qut	dj
|���nI|
tkrL|dtjB}n)|
tkrl|dtjA}n	tj}|tjk	r�t�}x;tD]3}t|t�r�||@r�|jt|�q�q�W|r�|n||d<n|dk	r;|j�tkrt|j�}nt	dj
|���t||d<n	tj}|dk	r�|j�tkrut|j�}nt	d	j
|���t||d
<n	tj}|dk	r�||d<n|dkr�d}n|dk	r�d|d<n|	dk	r|	|d<n|
dk	r|
|d<n|dk	r6||d<ntj||||||	d|
|||�|dk	r�tj|tj|�||d<n|dk	r�|dkr�|ddks�|dkr�tj|tj|�||d<q�d|d<ntj|�tj|�|S(u}
    Modify a service's parameters. Changes will not be made for parameters that
    are not passed.

    .. versionadded:: 2016.11.0

    Args:
        name (str):
            The name of the service. Can be found using the
            ``service.get_service_name`` function

        bin_path (str):
            The path to the service executable. Backslashes must be escaped, eg:
            ``C:\path\to\binary.exe``

        exe_args (str):
            Any arguments required by the service executable

        display_name (str):
            The name to display in the service manager

        description (str):
            The description to display for the service

        service_type (str):
            Specifies the service type. Default is ``own``. Valid options are as
            follows:

            - kernel: Driver service
            - filesystem: File system driver service
            - adapter: Adapter driver service (reserved)
            - recognizer: Recognizer driver service (reserved)
            - own (default): Service runs in its own process
            - share: Service shares a process with one or more other services

        start_type (str):
            Specifies the service start type. Valid options are as follows:

            - boot: Device driver that is loaded by the boot loader
            - system: Device driver that is started during kernel initialization
            - auto: Service that automatically starts
            - manual: Service must be started manually
            - disabled: Service cannot be started

        start_delayed (bool):
            Set the service to Auto(Delayed Start). Only valid if the start_type
            is set to ``Auto``. If service_type is not passed, but the service
            is already set to ``Auto``, then the flag will be set.

        error_control (str):
            The severity of the error, and action taken, if this service fails
            to start. Valid options are as follows:

            - normal: Error is logged and a message box is displayed
            - severe: Error is logged and computer attempts a restart with the
              last known good configuration
            - critical: Error is logged, computer attempts to restart with the
              last known good configuration, system halts on failure
            - ignore: Error is logged and startup continues, no notification is
              given to the user

        load_order_group (str):
            The name of the load order group to which this service belongs

        dependencies (list):
            A list of services or load ordering groups that must start before
            this service

        account_name (str):
            The name of the account under which the service should run. For
            ``own`` type services this should be in the ``domain\username``
            format. The following are examples of valid built-in service
            accounts:

            - NT Authority\LocalService
            - NT Authority\NetworkService
            - NT Authority\LocalSystem
            - .\LocalSystem

        account_password (str):
            The password for the account name specified in ``account_name``. For
            the above built-in accounts, this can be None. Otherwise a password
            must be specified.

        run_interactive (bool):
            If this setting is True, the service will be allowed to interact
            with the user. Not recommended for services that run with elevated
            privileges.

    Returns:
        dict: a dictionary of changes made

    CLI Example:

    .. code-block:: bash

        salt '*' service.modify spooler start_type=disabled

    uFailed To Open {0}: {1}u{0} {1}u
BinaryPathuInvalid Service Type: {0}iuServiceTypeuInvalid Start Type: {0}u	StartTypeuInvalid Error Control: {0}uErrorControluServiceAccountuLocalSystemuLocalServiceuNetworkServiceuuXXX-REDACTED-XXXuServiceAccountPassworduLoadOrderGroupuDependenciesuDisplayNameuDescriptioni����iiuStartTypeDelayedu)start_delayed: Requires start_type "auto"uWarningN(uLocalSystemuLocalServiceuNetworkService( R-R.RR:R>tSERVICE_CHANGE_CONFIGRAR;R<RRR=RCR6RR(RLtSERVICE_INTERACTIVE_PROCESSR)RtSERVICE_NO_CHANGERKRMRNRORSRTtChangeServiceConfigtChangeServiceConfig2RFRGR3(R*tbin_pathtexe_argstdisplay_nameRZtservice_typeR_t
start_delayedt
error_controltload_order_grouptdependenciestaccount_nametaccount_passwordtrun_interactiveR4RWRVRXtchangesR]R^((s</usr/lib/python2.7/site-packages/salt/modules/win_service.pyRa�s�u	


		
		
	



	
(	



cK@s|t|d|d|�t|�}|j�dkr^|dj�|j�ko]|d|kS|dj�|j�kSdS(u�
    Enable the named service to start at boot

    Args:
        name (str): The name of the service to enable.

        start_type (str): Specifies the service start type. Valid options are as
            follows:

            - boot: Device driver that is loaded by the boot loader
            - system: Device driver that is started during kernel initialization
            - auto: Service that automatically starts
            - manual: Service must be started manually
            - disabled: Service cannot be started

        start_delayed (bool): Set the service to Auto(Delayed Start). Only valid
            if the start_type is set to ``Auto``. If service_type is not passed,
            but the service is already set to ``Auto``, then the flag will be
            set.

    Returns:
        bool: ``True`` if successful, ``False`` otherwise

    CLI Example:

    .. code-block:: bash

        salt '*' service.enable <service name>
    R_R�uautou	StartTypeuStartTypeDelayedN(RaRR((R*R_R�R}tsvcstat((s</usr/lib/python2.7/site-packages/salt/modules/win_service.pytenable�s
*cK@s$t|dd�t|�ddkS(u
    Disable the named service to start at boot

    Args:
        name (str): The name of the service to disable

    Returns:
        bool: ``True`` if disabled, ``False`` otherwise

    CLI Example:

    .. code-block:: bash

        salt '*' service.disable <service name>
    R_uDisabledu	StartType(RaR(R*R}((s</usr/lib/python2.7/site-packages/salt/modules/win_service.pytdisable�scK@st|�ddkS(u$
    Check to see if the named service is enabled to start on boot

    Args:
        name (str): The name of the service to check

    Returns:
        bool: True if the service is set to start

    CLI Example:

    .. code-block:: bash

        salt '*' service.enabled <service name>
    u	StartTypeuAuto(R(R*R}((s</usr/lib/python2.7/site-packages/salt/modules/win_service.pytenabled�scC@st|�S(u"
    Check to see if the named service is disabled to start on boot

    Args:
        name (str): The name of the service to check

    Returns:
        bool: True if the service is disabled

    CLI Example:

    .. code-block:: bash

        salt '*' service.disabled <service name>
    (R�(R*((s</usr/lib/python2.7/site-packages/salt/modules/win_service.pyR`�su
.\LocalSystemcK@s1|dkr|}n|t�kr<tdj|���nt|�}|dk	ridj||�}n|j�tkr�t|j�}|
r�|tjB}q�ntdj|���|j�t	kr�t	|j�}ntdj|���|j�t
krt
|j�}ntdj|���|rQ|dkrQtd��qQn|dkrfd}ntjddtj�}tj
|||tj|||||	d|
||�
}|dk	r�tj|tj|�n|dk	r
|dkr
tj|tj|�q
ntj|�tj|�t|�S(u�
    Create the named service.

    .. versionadded:: 2015.8.0

    Args:

        name (str):
            Specifies the service name. This is not the display_name

        bin_path (str):
            Specifies the path to the service binary file. Backslashes must be
            escaped, eg: ``C:\path\to\binary.exe``

        exe_args (str):
            Any additional arguments required by the service binary.

        display_name (str):
            The name to be displayed in the service manager. If not passed, the
            ``name`` will be used

        description (str):
            A description of the service

        service_type (str):
            Specifies the service type. Default is ``own``. Valid options are as
            follows:

            - kernel: Driver service
            - filesystem: File system driver service
            - adapter: Adapter driver service (reserved)
            - recognizer: Recognizer driver service (reserved)
            - own (default): Service runs in its own process
            - share: Service shares a process with one or more other services

        start_type (str):
            Specifies the service start type. Valid options are as follows:

            - boot: Device driver that is loaded by the boot loader
            - system: Device driver that is started during kernel initialization
            - auto: Service that automatically starts
            - manual (default): Service must be started manually
            - disabled: Service cannot be started

        start_delayed (bool):
            Set the service to Auto(Delayed Start). Only valid if the start_type
            is set to ``Auto``. If service_type is not passed, but the service
            is already set to ``Auto``, then the flag will be set. Default is
            ``False``

        error_control (str):
            The severity of the error, and action taken, if this service fails
            to start. Valid options are as follows:

            - normal (normal): Error is logged and a message box is displayed
            - severe: Error is logged and computer attempts a restart with the
              last known good configuration
            - critical: Error is logged, computer attempts to restart with the
              last known good configuration, system halts on failure
            - ignore: Error is logged and startup continues, no notification is
              given to the user

        load_order_group (str):
            The name of the load order group to which this service belongs

        dependencies (list):
            A list of services or load ordering groups that must start before
            this service

        account_name (str):
            The name of the account under which the service should run. For
            ``own`` type services this should be in the ``domain\username``
            format. The following are examples of valid built-in service
            accounts:

            - NT Authority\LocalService
            - NT Authority\NetworkService
            - NT Authority\LocalSystem
            - .\LocalSystem

        account_password (str):
            The password for the account name specified in ``account_name``. For
            the above built-in accounts, this can be None. Otherwise a password
            must be specified.

        run_interactive (bool):
            If this setting is True, the service will be allowed to interact
            with the user. Not recommended for services that run with elevated
            privileges.

    Returns:
        dict: A dictionary containing information about the new service

    CLI Example:

    .. code-block:: bash

        salt '*' service.create <service name> <path to exe> display_name='<display name>'
    uService Already Exists: {0}u{0} {1}uInvalid Service Type: {0}uInvalid Start Type: {0}uInvalid Error Control: {0}iu;Invalid Parameter: start_delayed requires start_type "auto"uLocalSystemu
.\LocalSystemuLocalServiceu.\LocalServiceuNetworkServiceu.\NetworkServiceuiN(uLocalSystemu
.\LocalSystemuLocalServiceu.\LocalServiceuNetworkServiceu.\NetworkService(RR'RRRR(RLR-R�RSRTR.tSC_MANAGER_ALL_ACCESSt
CreateServicetSERVICE_ALL_ACCESSR�RFRGR3R(R*R�R�R�RZR�R_R�R�R�R�R�R�R�R}R4RW((s</usr/lib/python2.7/site-packages/salt/modules/win_service.pytcreate�spr						


cC@sjtjddtj�}ytj||tj�}Wngtjk
r�}tj|�|j	dkr�t
dj||j���nt
jdj|��tSXzIytj|�Wn1tjk
r�}t
dj||j���nXWdt
jd�tj|�tj|�Xtj�t|�}x2|t�kr\tj�|kr\tjd�q+W|t�kS(uf
    Delete the named service

    Args:

        name (str): The name of the service to delete

        timeout (int):
            The time in seconds to wait for the service to be deleted before
            returning. This is necessary because a service must be stopped
            before it can be deleted. Default is 90 seconds

            .. versionadded:: 2017.7.9,2018.3.4

    Returns:
        bool: ``True`` if successful, otherwise ``False``. Also returns ``True``
            if the service is not present

    CLI Example:

    .. code-block:: bash

        salt '*' service.delete <service name>
    i$uFailed to open {0}. {1}uService "{0}" is not presentuFailed to delete {0}. {1}NuCleaning upi(R-R.RR:R>R�R;R<R3RdRRR=ReRfR)t
DeleteServiceR
RNR'R(R*RgR4RWRVR((s</usr/lib/python2.7/site-packages/salt/modules/win_service.pytdelete�s2
 

$(:t__doc__t
__future__RRRR{tloggingRR
tsalt.utils.platformRtsalt.utils.pathtsalt.exceptionsRRHR-RbR;R)R	tImportErrorRt	getLoggert__name__ReR
RLRPRURQRSRTRRRR%R&R+R,RR'R9RRiRkRnRlRmR�R�RRaR�R�R�R`R�R�(((s</usr/lib/python2.7/site-packages/salt/modules/win_service.pyt<module>s�














	
	-								&	m.&'			%	�'			�

Zerion Mini Shell 1.0