+
    Dfj	                     h    R t ^ RIHtHt ^ RIHt ^ RIHt  ! R R]P                  4      tR R lt	R# )	z>
Support for creating a service which runs a process monitor.
)ListSequence)usage)ProcessMonitorc                      a  ] tR t^t o RtRtRR^R].RR^R].R	R
^R].RRRR]..t. tRt	V 3R lR lt
V 3R lR ltV 3R ltRtV tR# )Optionsz>
Define the options accepted by the I{twistd procmon} plugin.
z[procmon options] commandline	thresholdtzRHow long a process has to live before the death is considered instant, in seconds.killtimekzpHow 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 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 10c                $   < V ^8  d   QhRS[ RR/# )   argsreturnN)str)format__classdict__s   ";/usr/lib/python3/dist-packages/twisted/runner/procmontap.py__annotate__Options.__annotate__I   s      s t     c                    WR&   R# )zA
Grab the command line that is going to be started and monitored
r   N )selfr   s   &*r   	parseArgsOptions.parseArgsI   s     Vr   c                   < V ^8  d   QhRR/# )r   r   Nr   )r   r   s   "r   r   r   O   s     K KT Kr   c                `    \        V R,          4      ^8  d   \        P                  ! R4      hR# )z
Check for dependencies.
r   z$Please specify a process commandlineN)lenr   
UsageError)r   s   &r   postOptionsOptions.postOptionsO   s,     tF|q ""#IJJ !r   c                F   < V ^8  d   Qh/ S[ S[S[,          ,          ;R&   # )r   optFlags)r   r   r   )r   r   s   "r   r   r      s     Z 8C=!&[ r   r   N)__name__
__module____qualname____firstlineno____doc__synopsisfloatoptParametersr'   longdescr   r$   __annotate_func____static_attributes____classdictcell__)r   s   @r   r   r      s      /H B	
 ) 	
  	
  	
7$ML %'H	H K KA  r   r   c                0    V ^8  d   QhR\         R\        /# )r   configr   )r   r   )r   s   "r   r   r   W   s     	 	 	N 	r   c                     \        4       pV R ,          Vn        V R,          Vn        V R,          Vn        V R,          Vn        VP                  RP                  V R,          4      V R,          4       V# )r   r
   r   r    r   )r   r   killTimeminRestartDelaymaxRestartDelay
addProcessjoin)r5   ss   & r   makeServicer>   W   sb    A%AK
#AJ01A01ALL&.)6&>:Hr   N)
r,   typingr   r   twisted.pythonr   twisted.runner.procmonr   r   r>   r   r   r   <module>rB      s/   
 "   1EKemm EKP	r   