AnonSec Shell
Server IP : 209.38.156.173  /  Your IP : 216.73.216.122   [ Reverse IP ]
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64
User : root ( 0)
PHP Version : 8.1.2-1ubuntu2.22
Disable Function : NONE
Domains : 2 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /proc/thread-self/root/usr/lib/python3/dist-packages/uaclient/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /proc/thread-self/root/usr/lib/python3/dist-packages/uaclient/__pycache__/lock.cpython-310.pyc
o

F��c�@shddlZddlZddlZddlZddlmZmZe�d�Zda	dd�Z
Gdd�d�ZGdd	�d	e�ZdS)
�N)�config�
exceptionszpro.lockcCstrt�dSdS�N)�clear_lock_file�rr�//usr/lib/python3/dist-packages/uaclient/lock.py�clear_lock_file_if_presents
�rc@s4eZdZdZdejdefdd�Zdd�Zdd	�Z	d
S)�SingleAttemptLocka�
    Context manager for gaining exclusive access to the lock file.
    Create a lock file if absent. The lock file will contain a pid of the
    running process, and a customer-visible description of the lock holder.

    :param lock_holder: String with the service name or command which is
        holding the lock. This lock_holder string will be customer visible in
        status.json.
    :raises: LockHeldError if lock is held.
    �cfg�lock_holdercGs||_||_dSr�r
r)�selfr
r�_argsrrr�__init__"s
zSingleAttemptLock.__init__cCst|j��\}}|dkrtj|j||d��|j�dd�t��|j��d�|j�}|jj	�
d|�t�|jj
d�adS)Nr)�lock_requestr�pid�lockz{}:{}zOperation in progress: {}�)r
�check_lock_infor�
LockHeldErrorr�write_cache�format�os�getpid�notice_file�add�	functools�partial�delete_cache_keyr)r
�lock_pid�cur_lock_holder�
notice_msgrrr�	__enter__&s��zSingleAttemptLock.__enter__cCs|j�d�dadS)Nr)r
rr)r
�	_exc_type�
_exc_value�
_tracebackrrr�__exit__6szSingleAttemptLock.__exit__N)
�__name__�
__module__�__qualname__�__doc__r�UAConfig�strrr"r&rrrrr	s
r	c	sHeZdZdZddd�dejdededef�fd	d
�Z�fdd�Z	�Z
S)
�SpinLocka�
    Context manager for gaining exclusive access to the lock file. In contrast
    to the SingleAttemptLock, the SpinLock will try several times to acquire
    the lock before giving up. The number of times to try and how long to sleep
    in between tries is configurable.

    :param lock_holder: String with the service name or command which is
        holding the lock. This lock_holder string will be customer visible in
        status.json.
    :param sleep_time: Number of seconds to sleep before retrying if the lock
        is already held.
    :param max_retries: Maximum number of times to try to grab the lock before
        giving up and raising a LockHeldError.
    :raises: LockHeldError if lock is held after (sleep_time * max_retries)
    �
�)�
sleep_time�max_retriesr
rr0r1cs t�j||d�||_||_dS)Nr)�superrr0r1)r
r
rr0r1r��	__class__rrrMs
zSpinLock.__init__c
s�t�d�|j��d}	zt���WdStjyD}z#t�d�|d|j��|d7}||j	kr4|�t
�|j�WYd}~nd}~wwq)Nzspin lock starting for {}rTz$SpinLock Attempt {}. {}. Spinning...�)
�LOG�debugrrr2r"rr�msgr1�time�sleepr0)r
�tries�er3rrr"Ys&

��
���zSpinLock.__enter__)r'r(r)r*rr+r,�intrr"�
__classcell__rrr3rr-<s�����r-)
r�loggingrr9�uaclientrr�	getLoggerr6rrr	r-rrrr�<module>s
&

Anon7 - 2022
AnonSec Team