Ë
    ojñ	  ã                   ój   — d Z ddlmZmZ ddlmZ ddlmZ  G d„ dej                  «      Zdedefd	„Z	y
)z>
Support for creating a service which runs a process monitor.
é    )ÚListÚSequence)Úusage)ÚProcessMonitorc                   ó€   — e Zd ZU dZdZddddegddd	d
egddddegddddeggZg Zee	e
      ed<   dZde
ddfd„Zdd„Zy)Ú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ÚMi  zLThe maximum time (in seconds) to wait before attempting to restart a processÚoptFlagsa`  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 10ÚargsÚreturnNc                 ó   — || d<   y)zQ
        Grab the command line that is going to be started and monitored
        r   N© )Úselfr   s     ú;/usr/lib/python3/dist-packages/twisted/runner/procmontap.pyÚ	parseArgszOptions.parseArgsI   s   € ð ˆˆVŠó    c                 óP   — t        | d   «      dk  rt        j                  d«      ‚y)z)
        Check for dependencies.
        r   r   z$Please specify a process commandlineN)Úlenr   Ú
UsageError)r   s    r   ÚpostOptionszOptions.postOptionsO   s,   € ô ˆt�F‰|Ó˜qÒ Ü×"Ñ"Ð#IÓJÐJð !r   )r   N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__ÚsynopsisÚfloatÚoptParametersr   r   r   ÚstrÚ__annotations__Úlongdescr   r   r   r   r   r   r      s²   … ñð /€Hð ØØðBàð	
ð ØØð)ð ð	
ð ØØðð ð	
ð ØØðð ð	
ð7$€MðL %'€Hˆd�8˜C‘=Ñ!Ó&ð	€Hð˜sð  tó ôKr   r   Úconfigr   c                 ó¸   — t        «       }| d   |_        | d   |_        | d   |_        | d   |_        |j                  dj                  | d   «      | d   «       |S )Nr	   r   r   r   ú r   )r   r	   ÚkillTimeÚminRestartDelayÚmaxRestartDelayÚ
addProcessÚjoin)r*   Úss     r   ÚmakeServicer3   W   sb   € ÜÓ€Aà˜Ñ%€A„KØ˜
Ñ#€A„JØÐ0Ñ1€AÔØÐ0Ñ1€AÔà‡L�L�—‘˜& ™.Ó)¨6°&©>Ô:Ø€Hr   N)
r#   Útypingr   r   Útwisted.pythonr   Útwisted.runner.procmonr   r   r3   r   r   r   ú<module>r7      s=   ðñ
÷ "å  Ý 1ôEKˆe�m‰mô EKðP	˜ð 	 Nô 	r   