File: //usr/lib/python3/dist-packages/fail2ban/server/__pycache__/jailthread.cpython-310.pyc
o
��_ � @ s� d Z dZdZddlZddlmZ ddlmZ ddlm Z d d
l
mZmZ G dd� de�Z
ejd
k r7e
je
_dS ee
d�sBe
je
_dS dS )z
Cyril Jaquierz Copyright (c) 2004 Cyril Jaquier�GPL� N)�Thread)�abstractmethod� )�Utils� )�
excepthook�prctl_set_th_namec s| e Zd ZdZd� fdd� Zejdkr� fdd�Zndd � Ze ddd��Z
� fd
d�Zdd� Ze dd� �Z
� fdd�Z� ZS )�
JailThreada Abstract class for threading elements in Fail2Ban.
Attributes
----------
daemon
ident
name
status
active : bool
Control the state of the thread.
idle : bool
Control the idle state of the thread.
sleeptime : int
The time the thread sleeps for in the loop.
Nc sH t t| �j|d� d| _d | _d| _tj| _| j � � fdd�}|| _ d S )N)�nameTFc
sh z
� | i |�� W d S t y3 } ztd urtt�� � nt|� W Y d }~d S W Y d }~d S d }~ww �N)� Exception�sysr �exc_info�print)�args�kwargs�e��run� �</usr/lib/python3/dist-packages/fail2ban/server/jailthread.py�run_with_except_hookC s ���z1JailThread.__init__.<locals>.run_with_except_hook)
�superr
�__init__�daemon�active�idler �DEFAULT_SLEEP_TIME� sleeptimer )�selfr r �� __class__r r r 4 s
zJailThread.__init__�� c s t | j� tt| ��� S r )r r r r
�
_bootstrap�r r! r r r% P s
zJailThread._bootstrapc C s t | j� t�| �S r )r r r �_Thread__bootstrapr&