CasperSecurity

Current Path : /usr/lib/python3/dist-packages/cloudinit/__pycache__/
Upload File :
Current File : //usr/lib/python3/dist-packages/cloudinit/__pycache__/signal_handler.cpython-310.pyc

o

쑛h��@s�UddlZddlZddlZddlZddlZddlmZddlmZm	Z	m
Z
mZddlm
ZddlmZe�e�ZdZe
ed<dZe
ed	<ejd
ejdejdiZe
e	eefed
<deeedfddfdd�Zdd�Zdd�Zdd�Z dS)�N)�StringIO)�Callable�Dict�Final�Union)�version)�log_utilz#Cloud-init {} received {}, exiting
�SIG_MESSAGE��BACK_FRAME_TRACE_DEPTHz/Cloud-init %(version)s received SIGINT, exitingz0Cloud-init %(version)s received SIGTERM, exitingz0Cloud-init %(version)s received SIGABRT, exiting�SIGNALS�sig�returncCs�t|�rt|tj�st�d|�dSdS|tjkr t�d�dS|dur+t�d�dS|tjkr8t�d|�dSt�	dt
|�|�dS)z+inspect_handler() logs signal handler statez.Signal state [%s] - previously custom handler.z,Signal state [SIG_IGN] - previously ignored.Nz;Signal state [None] - previously not installed from Python.zISignal state [%s] - default way of handling signal was previously in use.zSignal state [%s(%s)] - unknown)�callable�
isinstance�types�BuiltinFunctionType�LOG�info�signal�SIG_IGN�SIG_DFL�warning�type)r
�r�:/usr/lib/python3/dist-packages/cloudinit/signal_handler.py�inspect_handlers�

�rcCsz||ks|sdSt�|�}d|d}|�d||jf�|�d||jf�|�d||jf�t|j|d||�dS)N� �z%sFilename: %s
z%sFunction: %s
z%sLine number: %s
�)�inspect�getframeinfo�write�filename�function�lineno�
_pprint_frame�f_back)�frame�depth�	max_depth�contents�
frame_info�prefixrrrr&5s
r&cCsht|tj�r	|jn|}tt�t��|��}t	|dt
|�tjd|�d�|�
�ttjd�t�d�dS)NrzReceived signal z resulting in exit. Cause:
)�log�	log_levelr)rr�Signals�namerr	�format�vr�version_stringr&rr�	multi_log�getvaluer�logging�INFO�sys�exit)�signumr(r1r+rrr�_handle_exit@s
��r<cCs2d}t��D]
}tt�|t��q|tt�7}|S)zattach cloud-init's handlersr)r�keysrrr<�len)�
sigs_attachedr;rrr�attach_handlersNs
r@)!r r7rr9r�ior�typingrrrr�	cloudinitrr3�
cloudinit.logr�	getLogger�__name__rr	�__annotations__r�SIGINT�SIGTERM�SIGABRTr�int�strrr&r<r@rrrr�<module>s(

�
Hacker Blog, Shell İndir, Sql İnjection, XSS Attacks, LFI Attacks, Social Hacking, Exploit Bot, Proxy Tools, Web Shell, PHP Shell, Alfa Shell İndir, Hacking Training Set, DDoS Script, Denial Of Service, Botnet, RFI Attacks, Encryption
Telegram @BIBIL_0DAY