| Server IP : 192.250.235.158 / Your IP : 216.73.216.143 Web Server : LiteSpeed System : Linux s4099.sgp1.stableserver.net 5.14.0-503.21.1.el9_5.x86_64 #1 SMP PREEMPT_DYNAMIC Sun Jan 12 09:45:05 EST 2025 x86_64 User : vmxfzbqj ( 1905) PHP Version : 8.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /lib/python3.9/site-packages/supervisor/__pycache__/ |
Upload File : |
a
0�g� � @ sL d Z ddlZddlZddlZddlZG dd� d�Zdd� ZedkrHe� dS )a pidproxy -- run command and proxy signals to it via its pidfile.
This executable runs a command and then monitors a pidfile. When this
executable receives a signal, it sends the same signal to the pid
in the pidfile.
Usage: %s <pidfile name> <command> [<cmdarg1> ...]
� Nc @ s@ e Zd ZdZdd� Zdd� Zdd� Zdd � Zd
d� Zdd
� Z dS )�PidProxyNc C sb z4|d |dd � | _ }tj�|d �| _|| _W n( ttfy\ | �� t �
d� Y n0 d S )N� � r )�pidfile�os�path�abspath�abscmd�cmdargs�
ValueError�
IndexError�usage�sys�exit)�self�argsr
� r �7/usr/lib/python3.9/site-packages/supervisor/pidproxy.py�__init__ s
zPidProxy.__init__c C sb | � � t�tj| j| j�| _t�d� zt� dtj
�d }W n tyT d }Y n0 |rq^qd S )N� ���r )�
setsignalsr �spawnv�P_NOWAITr r
�pid�time�sleep�waitpid�WNOHANG�OSError)r r r r r �go s
zPidProxy.goc C s t ttjd � d S )Nr )�print�__doc__r �argv�r r r r r
) s zPidProxy.usagec C st t � t j| j� t � t j| j� t � t j| j� t � t j| j� t � t j| j� t � t j| j� t � t j| j � d S �N)
�signal�SIGTERM�passtochild�SIGHUP�SIGINT�SIGUSR1�SIGUSR2�SIGQUIT�SIGCHLD�reapr$ r r r r , s zPidProxy.setsignalsc C s d S r% r )r �sig�framer r r r/ 5 s z
PidProxy.reapc C s� z@t | jd�� }t|�� �� �}W d � n1 s40 Y W n td| j � Y d S 0 t�||� |tj tj
tjfv r�t�
d� d S )N�rzCan't read child pidfile %s!r )�openr �int�read�stripr! r �killr&