HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //usr/lib/python3/dist-packages/twisted/runner/__pycache__/procmontap.cpython-38.pyc
U


W[��@s:dZddlmZddlmZGdd�dej�Zdd�ZdS)	z>
Support for creating a service which runs a process monitor.
�)�usage)�ProcessMonitorc@s`eZdZdZdZddddegddd	d
egdddd
egddddeggZgZdZdd�Z	dd�Z
dS)�OptionszF
    Define the options accepted by the I{twistd procmon} plugin.
    z[procmon options] commandline�	threshold�t�zRHow long a process has to live before the death is considered instant, in seconds.�killtime�k�zpHow long a process being killed has to get its affairs in order before it gets killed with an unmaskable signal.�minrestartdelay�mzLThe minimum time (in seconds) to wait before attempting to restart a process�maxrestartdelay�MizLThe maximum time (in seconds) to wait before attempting to restart a processa`procmon runs processes, monitors their progress, and restarts them when they
die.

procmon will not attempt to restart a process that appears to die instantly;
with each "instant" death (less than 1 second, by default), it will delay
approximately twice as long before restarting it. A successful run will reset
the counter.

Eg twistd procmon sleep 10cGs||d<dS)zQ
        Grab the command line that is going to be started and monitored
        �argsN�)�selfrrr�;/usr/lib/python3/dist-packages/twisted/runner/procmontap.py�	parseArgs0szOptions.parseArgscCst|d�dkrt�d��dS)z)
        Check for dependencies.
        rrz$Please specify a process commandlineN)�lenrZ
UsageError)rrrr�postOptions7szOptions.postOptionsN)�__name__�
__module__�__qualname__�__doc__Zsynopsis�floatZ
optParametersZoptFlagsZlongdescrrrrrrr
s&�����rcCsLt�}|d|_|d|_|d|_|d|_|�d�|d�|d�|S)Nrrrr
� r)rrZkillTimeZminRestartDelayZmaxRestartDelayZ
addProcess�join)Zconfig�srrr�makeService@s



rN)rZtwisted.pythonrZtwisted.runner.procmonrrrrrrr�<module>s3