??????????????
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 173
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 174
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 175
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 176
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 177
Warning: Cannot modify header information - headers already sent by (output started at /home/mybf1/public_html/mentol.bf1.my/SS1.php:4) in /home/mybf1/public_html/mentol.bf1.my/SS1.php on line 178
Udac @` s d d l m Z m Z m Z e Z i d d 6d g d 6d d 6Z d Z d Z d d
l Z d d
l
Z
d d
l Z d d l m
Z
d d l m Z d
Z d e f d YZ d Z e d k r e n d
S( i ( t absolute_importt divisiont print_functions 1.1t metadata_versiont stableinterfacet statust communityt supported_bysS
---
module: svc
author:
- Brian Coca (@bcoca)
version_added: "1.9"
short_description: Manage daemontools services
description:
- Controls daemontools services on remote hosts using the svc utility.
options:
name:
description:
- Name of the service to manage.
type: str
required: true
state:
description:
- C(Started)/C(stopped) are idempotent actions that will not run
commands unless necessary. C(restarted) will always bounce the
svc (svc -t) and C(killed) will always bounce the svc (svc -k).
C(reloaded) will send a sigusr1 (svc -1).
C(once) will run a normally downed svc once (svc -o), not really
an idempotent operation.
type: str
choices: [ killed, once, reloaded, restarted, started, stopped ]
downed:
description:
- Should a 'down' file exist or not, if it exists it disables auto startup.
Defaults to no. Downed does not imply stopped.
type: bool
default: no
enabled:
description:
- Whether the service is enabled or not, if disabled it also implies stopped.
Take note that a service can be enabled and downed (no auto restart).
type: bool
service_dir:
description:
- Directory svscan watches for services
type: str
default: /service
service_src:
description:
- Directory where services are defined, the source of symlinks to service_dir.
type: str
default: /etc/service
s4
- name: Start svc dnscache, if not running
svc:
name: dnscache
state: started
- name: Stop svc dnscache, if running
svc:
name: dnscache
state: stopped
- name: Kill svc dnscache, in all cases
svc:
name: dnscache
state: killed
- name: Restart svc dnscache, in all cases
svc:
name: dnscache
state: restarted
- name: Reload svc dnscache, in all cases
svc:
name: dnscache
state: reloaded
- name: Using alternative svc directory location
svc:
name: dnscache
state: reloaded
service_dir: /var/service
N( t
AnsibleModule( t to_nativec O` s d } | d j d } | d k rd x> | j D]- } | j d k r0 | j | k r0 | } q0 q0 Wn | d k ry | } n t | | j | S( s-
Used for derivative implementations
t modulet distroN( t Nonet paramst __subclasses__R t supert __new__( t clst argst kwargst subclassR t sc( ( s> /usr/lib/python2.7/site-packages/ansible/modules/system/svc.pyt _load_dist_subclassg s t Svcc B` s e Z d Z d Z d Z d Z d Z d Z d Z d Z d Z
d Z d
Z d Z
d Z d
Z RS( s
Main class that handles daemontools, can be subclassed and overridden in case
we want to use a 'derivative' like encore, s6, etc
c C` s d d g | _ d d d d d d d d
g | _ | | _ | j d | _ | j d | _ | j d
| _ d | _ d | _ d | _
d | _ d | _ d | _
| j d d | j | _ | j d d | j | _ d j | j | j g | _ d j | j | j g | _ t j j | j | _ | j r[t j j d | j | _ | j n% t j j d | j | _ d | _ d S( Ns /commands /usr/local/bint statet enabledt downedt svc_fullt src_fullt pidt durationt
full_statet namet service_dirt service_srct svct opt_dirst svstatt /s %s/downt stopped( t extra_pathst report_varsR
R
R R! R" R R R R R R R t get_bin_patht svc_cmdt
svstat_cmdt joinR R t ost patht lexistst
get_status( t selfR
( ( s> /usr/lib/python2.7/site-packages/ansible/modules/system/svc.pyt __init__ s, !
c C` s t j j | j rn y t j | j | j Wq t k
rj } | j j d | j d d t | q Xn | j j d d | j d S( NR/ t msgs Error while linking: %ss1 Could not find source for service to enable (%s).(
R. R/ t existsR t symlinkR t OSErrorR
t fail_jsonR ( R2 t e( ( s> /usr/lib/python2.7/site-packages/ansible/modules/system/svc.pyt enable s -c C` s y t j | j Wn9 t k
rO } | j j d | j d d t | n X| j | j d | j g d | j } t j
j | r | j | j d | g n d S( NR/ R4 s Error while unlinking: %ss -dxs %s/log( R. t unlinkR R7 R
R8 R t execute_commandR+ R R/ R5 ( R2 R9 t src_log( ( s> /usr/lib/python2.7/site-packages/ansible/modules/system/svc.pyt disable s *
c C` s, | j | j | j g \ } } } | d k rI | rI | | _ | _ n | | _ t j d | } | r | j d | _ n t j d | } | r | j d | _
n t j d | r d | _ n+ t j d | r d | _ n
d | _ d St j d | r| j d
7_ n | j d 7_ d S( Ns
\(pid (\d+)\)i s
(\d+) secondss up t starts down t stoppt unknowns want t ingt ed( R<