HEX
Server: nginx/1.24.0
System: Linux prod-btpayments-io 6.14.0-1018-aws #18~24.04.1-Ubuntu SMP Mon Nov 24 19:46:27 UTC 2025 x86_64
User: ubuntu (1000)
PHP: 8.3.19
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/supervisor/__pycache__/pidproxy.cpython-312.pyc
�

���f���\�dZddlZddlZddlZddlZGd�d�Zd�Zedk(re�yy)apidproxy -- 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�4�eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	y)�PidProxyNc��	|d|ddc|_}tjj|d�|_||_y#ttf$r(|j�tjd�YywxYw)N��r)�pidfile�os�path�abspath�abscmd�cmdargs�
ValueError�
IndexError�usage�sys�exit)�self�argsr
s   �5/usr/lib/python3/dist-packages/supervisor/pidproxy.py�__init__zPidProxy.__init__sf��	�$(��G�T�!�"�X�!�D�L�'��'�'�/�/�'�!�*�5�D�K�"�D�L���J�'�	��J�J�L��H�H�Q�K�	�s�>A�4A8�7A8c�D�|j�tjtj|j|j
�|_	tjd�	tjdtj�d}|ry�A#t$rd}Y�wxYw)N����r)�
setsignalsr	�spawnv�P_NOWAITrr
�pid�time�sleep�waitpid�WNOHANG�OSError)rrs  r�gozPidProxy.gos{�������9�9�R�[�[�$�+�+�t�|�|�D�����J�J�q�M�
��j�j��R�Z�Z�0��3�������
���
�s�&'B�B�Bc�J�tttjdz�y)Nr)�print�__doc__r�argv�rs rrzPidProxy.usage)s��
�g������#�$�c��tjtj|j�tjtj|j�tjtj|j�tjtj
|j�tjtj|j�tjtj|j�tjtj|j�y�N)
�signal�SIGTERM�passtochild�SIGHUP�SIGINT�SIGUSR1�SIGUSR2�SIGQUIT�SIGCHLD�reapr(s rrzPidProxy.setsignals,s����
�
�f�n�n�d�&6�&6�7��
�
�f�m�m�T�%5�%5�6��
�
�f�m�m�T�%5�%5�6��
�
�f�n�n�d�&6�&6�7��
�
�f�n�n�d�&6�&6�7��
�
�f�n�n�d�&6�&6�7��
�
�f�n�n�d�i�i�0r)c��yr+�)r�sig�frames   rr5z
PidProxy.reap5s��r)c��	t|jd�5}t|j�j	��}ddd�t
j|�|tjtjtjfvrtjd�yy#1swY�gxYw#td|jz�YyxYw)N�rzCan't read child pidfile %s!r)�openr�int�read�stripr%r	�killr,r-r0r3rr)rr8r9�frs     rr.zPidProxy.passtochild9s���	��d�l�l�C�(�
,�A��!�&�&�(�.�.�*�+��
,�
	����S���6�>�>�6�=�=�&�.�.�A�A��H�H�Q�K�B�

,�
,��	��0�4�<�<�?�@��s"�B2�(B&�B2�&B/�+B2�2C)
�__name__�
__module__�__qualname__rrr#rrr5r.r7r)rrrs%��
�C��
�%�1�
�	r)rc�V�ttj�}|j�yr+)rrr'r#)�pps r�mainrGDs��	�#�(�(�	�B��E�E�Gr)�__main__)r&r	rr,rrrGrBr7r)r�<module>rIs<���
�
�
��1�1�f��z���F�r)