관리-도구
편집 파일: base.cpython-311.pyc
� b��fz � � � d Z ddlZddlZddlZddlZddlZddlZddlZddlZddl Z ddl m Z mZ ddlmZ ddl m Z mZmZ ddlZddlmZ ddlmZmZ ddlmZmZ dd lmZ dd lmZ ddlmZ ddlm Z! d dl"m#Z# d dl$m%Z% d dl&m'Z' d dl(m)Z)m*Z*m+Z+m,Z,m-Z- d dl.m/Z/ d dl0m1Z1 d dl2m3Z3 d dl4m5Z5m6Z6m7Z7 d dl8m9Z9 d dl:m;Z; d dl<m=Z=m>Z>m?Z? d dl@mAZAmBZBmCZCmDZDmEZEmFZF d dlGmHZHmIZImJZJmKZKmLZL e jM rd dlNmOZO G d� d� � ZPdS )zX This module contains classes implementing X-Ray Manager behaviour and helper functions � N)�datetime� timedelta)�glob)�Iterator�Optional�Tuple)�Feature)�is_panel_feature_supported�get_installed_php_versions)�php_get_vhost_versions�is_wpos_supported)�is_litespeed_running)�drop_privileges)� disable_quota)�gettext� )�ClWposGetter)� get_client)�ContinuousManager)�XRayManagerError�XRayAPIError�XRayMissingDomain�XRayManagerExit�XRayManagerExitPHPUnsupported)�FPMReloadController)�open_local_storage)�NginxUserCache)� DomainInfo�Task� url_split)�ManageUserAgent)�AdvancedMetrics)�get_xray_exec_user�user_mode_restricted�nginx_user_cache)�no_active_tasks�switch_schedstats�ssa_disabled�_cagefsctl_remount�set_privileges�is_file_recently_modified)�create_ini_files�remove_ini_files�is_global_ini_mode�remove_global_ini_mode_marker�create_global_ini_mode_marker)� APIClientc � � e Zd ZdZdZddddddd d ddd dd�Zd^dedefd�Zde e fd�Zdefd�Z dedefd�Zdedefd�Zdedefd�Zdedefd�Zdedefd�Zdeddfd�Zd � Zd!edefd"�Zed#edeej fd$�� � Zd%eddfd&�Zd'edefd(�Zd)edefd*�Zdedefd+�Z d,edefd-�Z!d,eddfd.�Z"ed!ede#ee f fd/�� � Z$d0eddfd1�Z%edefd2�� � Z&d_d4�Z'e(ddd5�d'ed6ed7ed8e d9ed:edd3fd;�� � Z)d'edd3fd<�Z*d=d>�d'ed8e dd3fd?�Z+d@edd3fdA�Z,dB� Z-e(d@edd3fdC�� � Z.d@edd3fdD�Z/edEedefdF�� � Z0d_dG�Z1edHe2dIdJfdK�� � Z3d@edd3fdL�Z4d'edMedd3fdN�Z5d'edd3fdO�Z6d'edd3fdP�Z7d'edd3fdQ�Z8d_dR�Z9d_dS�Z:dTedd3fdU�Z;dTedVe dd3fdW�Z<d_dX�Z=d_dY�Z>d_dZ�Z?d_d[�Z@d_d\�ZAd_d]�ZBdS )`�BaseManagerz� Basic manager abstract class. Implements methods common for all managers. Requires managers to implement their custom methods. z/var/run/xray-agent.pidz/opt/alt/php54/link/confz/opt/alt/php55/link/confz/opt/alt/php56/link/confz/opt/alt/php70/link/confz/opt/alt/php71/link/confz/opt/alt/php72/link/confz/opt/alt/php73/link/confz/opt/alt/php74/link/confz/opt/alt/php80/link/confz/opt/alt/php81/link/confz/opt/alt/php82/link/confz/opt/alt/php83/link/conf)z alt-php54z alt-php55z alt-php56z alt-php70z alt-php71z alt-php72z alt-php73z alt-php74z alt-php80z alt-php81z alt-php82z alt-php83F� system_id�phpinfo_modec � � t � � | _ || _ t j d� � | _ t � � | _ t � � | _ || _ t d� � | j �� � | _ d S )N�manager�lists�r4 )r �api_client_class�sys_id�logging� getLogger�loggerr �continuous_monitoringr! �manage_user_agentr5 � ui_api_client)�selfr4 r5 s �H/opt/cloudlinux/venv/lib64/python3.11/site-packages/xray/manager/base.py�__init__zBaseManager.__init__c sr � � 2<���������'� �2�2���%6�%8�%8��"�!0�!2�!2���(���0�Z��0�0�4�;�G�G�G����� �returnc � � t | j � � 5 }t |� � � � � cd d d � � S # 1 swxY w Y d S # t t f$ r t j d� � Y d S w xY w)Nz'Unable to read daemon pid from pidfile.)�open�DAEMON_PIDFILE�int�read�OSError�IOErrorr<