golden hour
/opt/imunify360/venv/lib/python3.11/site-packages/clcommon/__pycache__
⬆️ Go Up
Upload
File/Folder
Size
Actions
__init__.cpython-311.pyc
1.54 KB
Del
OK
clcagefs.cpython-311.pyc
15.5 KB
Del
OK
clcaptain.cpython-311.pyc
4.31 KB
Del
OK
clconfig.cpython-311.pyc
3.19 KB
Del
OK
clconfpars.cpython-311.pyc
16.37 KB
Del
OK
clcustomscript.cpython-311.pyc
1.85 KB
Del
OK
cldebug.cpython-311.pyc
1.29 KB
Del
OK
clemail.cpython-311.pyc
2.42 KB
Del
OK
clexception.cpython-311.pyc
1.7 KB
Del
OK
clfunc.cpython-311.pyc
11.95 KB
Del
OK
clhook.cpython-311.pyc
6.16 KB
Del
OK
cllog.cpython-311.pyc
2.78 KB
Del
OK
cloutput.cpython-311.pyc
846 B
Del
OK
clproc.cpython-311.pyc
8.93 KB
Del
OK
clpwd.cpython-311.pyc
11.97 KB
Del
OK
clquota.cpython-311.pyc
1.79 KB
Del
OK
clsec.cpython-311.pyc
1.55 KB
Del
OK
clwpos_lib.cpython-311.pyc
20.95 KB
Del
OK
const.cpython-311.pyc
293 B
Del
OK
evr_utils.cpython-311.pyc
5.06 KB
Del
OK
features.cpython-311.pyc
6.08 KB
Del
OK
group_info_reader.cpython-311.pyc
6.46 KB
Del
OK
lock.cpython-311.pyc
1.97 KB
Del
OK
mail_helper.cpython-311.pyc
7.2 KB
Del
OK
mysql_lib.cpython-311.pyc
10.01 KB
Del
OK
php_conf_reader.cpython-311.pyc
11.29 KB
Del
OK
sysctl.cpython-311.pyc
10.42 KB
Del
OK
ui_config.cpython-311.pyc
4.69 KB
Del
OK
utils.cpython-311.pyc
40.28 KB
Del
OK
utils_cmd.cpython-311.pyc
4.19 KB
Del
OK
Edit: sysctl.cpython-311.pyc
� ��ip � �z � d dl Z d dlmZ d dlmZmZmZ d dlmZm Z dZ dZ G d� d� � Z G d � d � � Z dS )� N)�ConfigParser)�run_command�get_file_lines�ExternalProgramFailed)�AnyStr�Listz /etc/sysctl.d/90-cloudlinux.confz/etc/sysctl.confc �z � e Zd ZdZdZedfd�Zd� Zed� � � Z d� Z ed� � � Zd � Z d � Zd� Zdd�Zd � ZdS )� SysCtlConfz( For reading params from sysctl z/sbin/sysctlTc �@ � || _ | j � d�| _ || _ dS )z� :param config_file: path to user defined systcl config file :param mute_errors: T/F value to define should we skip errors or not (used in cldiag checker) �.tmpN)�config_file�config_tmp_file�mute_errors)�selfr r s �o/builddir/build/BUILD/imunify360-venv-2.6.2/opt/imunify360/venv/lib/python3.11/site-packages/clcommon/sysctl.py�__init__zSysCtlConf.__init__ s. � � '���"&�"2�8�8�8���&����� c �j � | j dg} t |� � dS # t $ r | j s� Y dS w xY w)z> Apply all params from sysctl.d & sysctl.conf z--systemN)� SYSCTL_BINr r r )r �cmds r � _apply_allzSysCtlConf._apply_all$ sf � � �O�� �� � ��������$� � � ��#� �� � � � ���s � �2�2c �n � | j dd|g}t |d�� � \ }}}|� � � }|S )zM Read sysctl param :param name: name of sysctl param z-bz-nT)r �return_full_output)r r �strip)�cls�namer �ret_code�std_out�std_in�values r �_read_sysctl_paramzSysCtlConf._read_sysctl_param6 sP � � �N���� �� %0��#�% � % � % �!��'�6� � � �����r c �j � t | j dd�� � 5 }d� |� � }|� |� � |� � � t j |� � � � � ddd� � n# 1 swxY w Y t j | j | j � � dS )zm Write sysctl params to sysctl.conf :param lines: content for writing to sysctl.conf �w�utf-8��encoding� N) �openr �join�write�flush�os�fsync�fileno�renamer )r �lines�sysctl_confs r �_write_params_to_filez SysCtlConf._write_params_to_fileL s� � � �$�&��g� >� >� >� +�+��G�G�E�N�N�E����e�$�$�$��������H�[�'�'�)�)�*�*�*� +� +� +� +� +� +� +� +� +� +� +���� +� +� +� +� � �$�&��(8�9�9�9�9�9s �A%B � B �B c �\ � | � d� � d � � � S )N�=r )�splitr )�lines r �_get_param_name_from_linez$SysCtlConf._get_param_name_from_lineY s% � � �z�z�#���q�!�'�'�)�)�)r c �. � t | j � � }|S )zW Read content from sysctl.conf :return: lines from sysctl.conf )r r )r �results r �_read_sysctl_confzSysCtlConf._read_sysctl_conf_ s � � �� 0�1�1��� r c �j � �� � � � � }t �� fd�|D � � � � }|S )Nc 3 �J �K � | ]}��� |� � k V � �d S )N)r7 )�.0r6 � param_namer s ��r � <genexpr>z+SysCtlConf.has_parameter.<locals>.<genexpr>n s6 �� � � �_�_�D�Z�4�#A�#A�$�#G�#G�G�_�_�_�_�_�_r )r: �any)r r>