File: //opt/cloudlinux/venv/lib64/python3.11/site-packages/clveconfig/__pycache__/ve_lock.cpython-311.pyc
�
xޘf� � � � d dl mZ d dlZd dlZd dlmZ dZej � ed� � Z da
da G d� de� � Z
dd �Zd
� Zedd�� � ZdS )
� )�absolute_importN)�contextmanagerz/etc/containerz.ve.cfg.lockFc � � e Zd ZdS )�LockFailedExceptionN)�__name__�
__module__�__qualname__� � �I/opt/cloudlinux/venv/lib64/python3.11/site-packages/clveconfig/ve_lock.pyr r s � � � � � ��Dr r c � � t �dS | rda t t d� � a t j t � � � t j � � n# t $ r t d� � �w xY wt �
dd� � t � � � t � t t j � � � � � � t � � � dS )NFTza+z$IO error happened while getting lockr )�LOCK_FD�
LOCK_WRITE�open� LOCK_FILE�fcntl�flock�fileno�LOCK_EX�IOErrorr �seek�truncate�write�str�os�getpid�flush�r s r �setup_global_lockr s� � � ���u�� ��
�J��y�$�'�'��
��G�N�N�$�$�e�m�4�4�4�4��� J� J� J�!�"H�I�I�I�J�����L�L��A�����������M�M�#�b�i�k�k�"�"�#�#�#��M�M�O�O�O��4s �AA �A5c �` � t rdS t �t � � � d adS d S )NFT)r r �closer
r r �release_lockr"