ok

Mini Shell

Direktori : /opt/cloudlinux/venv/lib64/python3.11/site-packages/clconfigure/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib64/python3.11/site-packages/clconfigure/__pycache__/limits.cpython-311.pyc

�

;G�f�
����ddlZddlZddlmZmZddlmZddlmZm	Z	m
Z
mZmZm
Z
mZmZmZd�Zed��d���Zd�Zd	�Zed
��d���Zd�ZdS)
�N)�run�task)�install_package)	�STATE_FAILED�STATE_MASKED�
STATE_RUNNING�
STATE_STOPPED�STATE_UNMASKED�
STATE_ENABLED�STATE_DISABLED�get_service_state�set_service_statec�D�tdd���t��dS)Nz	lve-statsT)�	reinstall)r�enable_lve_services���py/clconfigure/limits.py�initialize_lvestatsrs'���K�4�0�0�0�0������rz2Changing default limits state to '{desired_state}'c�R�|dkrtgd���dStd���)z�
    Brings default limits to given state (unlimited | default).
    May be executed more that once, does't crash on future calls
    �	unlimited)�lvectl�set�defaultrz$Another states temporary unavailableN)r�RuntimeError)�
desired_states r�set_default_limits_staters9����#�#��5�5�5�6�6�6�6�6��A�B�B�Brc�^�tttfD]}dD]}t||����dS)z,
    Turn off all lve-related services.
    ��lve�lve_namespaces�lvestatsrN)r	rrr��state�services  r�disable_lve_servicesr&*sK�� ���>�.�.��F�	.�	.�G��e�W�-�-�-�-�	.�.�.rc�^�tttfD]}dD]}t||����dS)z+
    Turn on all lve-related services.
    rN)r
rrrr#s  rrr3sK��!�-��?�.�.��F�	.�	.�G��e�W�-�-�-�-�	.�.�.rzUnloading lve modulec�N��tddg��}|j�|j���ng��fd�dD��}|rtddg|���tgd���}tjd	�����rt
jd
��dSdS)zO
    Restart services that still use lve device and unload lve module then
    �lsofz/dev/lveNc�L���g|]�t�fd��D�������� S)c3�B�K�|]}|����V��dS)N)�
startswith)�.0�liner%s  �r�	<genexpr>z/unload_lve_module.<locals>.<listcomp>.<genexpr>Gs/�����E�E�D�t���w�'�'�E�E�E�E�E�Er)�any)r-r%�res_stdout_liness @�r�
<listcomp>z%unload_lve_module.<locals>.<listcomp>EsN���������E�E�E�E�4D�E�E�E�E�E�����r)�mysqld�mariadb�httpd�	systemctl�restart)�modprobez-rf�kmodlvez/sys/module/kmodlvez:Failed to unload the lve module. Please reboot the server.)r�stdout�split�pathlib�Path�exists�logging�warning)�res�servicesr1s  @r�unload_lve_modulerC<s�����v�z�"�
#�
#�C�-0�Z�-C�s�z�'�'�)�)�)�������=����H�
�1��[�)�/�h�/�0�0�0�

�,�,�,�
-�
-�C��|�)�*�*�1�1�3�3�V���T�U�U�U�U�U�V�Vrc���td��tkrdSttd��ttd��tt
d��ttd��dS)z�
    Apply workaround for the case
    When `systemctl stop lve` makes it transition to "failed" state instead of "inactive"
    r N)r
rrr
rr	rrrr�apply_workaround_lve_failedrERsb��
����<�/�/����n�e�,�,�,��m�U�+�+�+��m�U�+�+�+��l�E�*�*�*�*�*r)r?r<�clconfigurerr�clconfigure.packagesr�clconfigure.servicesrrrr	r
rrr
rrrr&rrCrErrr�<module>rIsK����������!�!�!�!�!�!�!�!�0�0�0�0�0�0�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
�
������:�;�;�C�C�<�;�C�.�.�.�.�.�.������V�V���V�*
+�
+�
+�
+�
+r

Zerion Mini Shell 1.0