%PDF- %PDF-
| Direktori : /proc/self/root/proc/self/root/usr/lib/python2.7/site-packages/salt/states/ |
| Current File : //proc/self/root/proc/self/root/usr/lib/python2.7/site-packages/salt/states/service.pyc |
�
���^c @@ s4 d Z d d l m Z m Z m Z d d l Z d d l Z d d l Z d d l m
Z d d l m
Z
d d l m Z d Z d
Z d � Z d � Z d
� Z e d � Z e d � Z d � Z d d d e e e d � Z d d d d � Z d � Z d � Z e d � Z e d � Z d d e e d e d � Z! d S( u�
Starting or restarting of services and daemons
==============================================
Services are defined as system daemons and are typically launched using system
init or rc scripts. This service state uses whichever service module is loaded
on the minion with the virtualname of ``service``. Services can be defined as
either running or dead.
If you need to know if your init system is supported, see the list of supported
:mod:`service modules <salt.modules.service.py>` for your desired init system
(systemd, sysvinit, launchctl, etc.).
Note that Salt's service execution module, and therefore this service state,
uses OS grains to ascertain which service module should be loaded and used to
execute service functions. As existing distributions change init systems or
new distributions are created, OS detection can sometimes be incomplete.
If your service states are running into trouble with init system detection,
please see the :ref:`Overriding Virtual Module Providers <module-provider-override>`
section of Salt's module documentation to work around possible errors.
.. note::
The current status of a service is determined by the return code of the init/rc
script status command. A status return code of 0 it is considered running. Any
other return code is considered dead.
.. code-block:: yaml
httpd:
service.running: []
The service can also be set to start at runtime via the enable option:
.. code-block:: yaml
openvpn:
service.running:
- enable: True
By default if a service is triggered to refresh due to a watch statement the
service is restarted. If the desired behavior is to reload the service, then
set the reload value to True:
.. code-block:: yaml
redis:
service.running:
- enable: True
- reload: True
- watch:
- pkg: redis
.. note::
More details regarding ``watch`` can be found in the
:ref:`Requisites <requisites>` documentation.
i ( t absolute_importt print_functiont unicode_literalsN( t get_function_argspec( t CommandExecutionError( t sixu no_blocku unmasku unmask_runtimeu servicec C@ s7 d t k r t St d j t j d t d � � f Sd S( ur
Only make these states available if a service provider has been detected or
assigned for this minion
u
service.startuP No service execution module loaded: check support for service management on {0} u osfingeru osN( t __salt__t __virtualname__t Falset formatt
__grains__t get( ( ( s7 /usr/lib/python2.7/site-packages/salt/states/service.pyt __virtual__N s c C@ s� i } g } t | � j } xX t D]P } | j | t � } | r"