ABKYH 发表于 2018-8-1 08:21:27

SaltStack源码分析之service状态模块

starting or restarting of services and daemons  
==============================================
  

  
Services are defined as system daemons typically started with system init or
  
rc scripts, services can be defined as running or dead.
  

  
.. code-block:: yaml
  

  
    httpd:
  
      service:
  
      - running
  

  
The service can also be set to be started at runtime via the enable option:
  

  
.. code-block:: yaml
  

  
    open***:
  
      service:
  
      - running
  
      - enable: True
  

  
By default if a service is triggered to refresh due to a watch statement the
  
service is by default 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
  
    :doc:`Requisites </ref/states/requisites>` documentation.
  

  
'''
页: [1]
查看完整版本: SaltStack源码分析之service状态模块