403Webshell
Server IP : 198.38.94.13  /  Your IP : 216.73.217.33
Web Server : Apache
System : Linux d4744.dxb1.stableserver.net 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64
User : revivere ( 1140)
PHP Version : 8.2.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/__pycache__/minion.cpython-310.pyc
o

;jk�@sjdZddlZddlZddlZddlZddlZddlZddlZe�	e
�Zdd�Zdd�Z
dd�Zd	d
�ZdS)z
Utility functions for minions
�Nc	Cszg}tj�|dd�}tj�|�s|St�|�D]"}tj�||�}zt||�}|dur0|�|�Wqty:Yqw|S)z0
    Return the running jobs on this minion
    �cachedir�procN)�os�path�join�isdir�listdir�_read_proc_file�append�OSError)�opts�retZproc_dir�fn_r�data�r�E/opt/saltstack/salt/lib/python3.10/site-packages/salt/utils/minion.py�runnings

��rcCs�tj�|ddt|�d�}tj�|�}tj�|�st�|�tjj	�
|d��}|�tj�
|��Wd�dS1s;wYdS)z(
    Write job information to cache
    rZminion_jobszreturn.pzw+bN)rrr�str�dirnamer�makedirs�salt�utils�files�fopen�write�payload�dumps)r�jidr
rZjdir�fp_rrr�
cache_jobs(s
"�rc
	Cs�t��j}t��}tjj�|d��9}|�	�}|�
�|r#tj�|�}n zt�
|�Wnty9t�d|�Ynw	Wd�dSWd�n1sMwYt|t�sYdStjj�|d�s{zt�
|�WdStyzt�d|�YdSw|�d�r�|�d�|kr�dSn�|�d�|kr�zt�
|�WdSty�t�d|�YdSwd�|�d�|�d��}d�|�d��}|�d�|ks�||ks�||kr�dS|�d�d	d
�t��D�vp�|dd
�t��D�v}	|	s�|dd
�t��D�v}	|	�s|d
d
�t��D�v}	|	�s zt�
|�WdSt�yt�d|�YdSwt|��sM|�d�}|�r3t�d|�zt�
|�WdSt�yLt�d|�YdSw|S)z0
    Return a dict of JID metadata, or None
    �rbzUnable to remove proc file %s.N�pid�multiprocessingz	{}-Job-{}rzProcessPayload(jid={})cS�g|]}|j�qSr��name��.0�xrrr�
<listcomp>cs�z#_read_proc_file.<locals>.<listcomp>cSr#rr$r&rrrr)e�cSr#rr$r&rrrr)gr*cSr#rr$r&rrrr)ir*z7PID %s exists but does not appear to be a salt process.)�	threading�current_threadr%r�getpidrrrr�read�closer�loads�remover�log�debug�
isinstance�dict�processZ
os_is_running�get�format�	enumerate�_check_cmdline�warning)
rrr,r!r�bufrZthread_nameZpp_name�foundrrrr	4s�
���
��
�������

��r	cCs�tjj��sdS|�d�}|sdStj�d�sdStj�d|�d��}tj�	|�s+dSz-tjj
�|d��}d|��vrE	Wd	�WdSWd	�Wd	S1sQwYWd	St
ybYdSw)
a9
    In some cases where there are an insane number of processes being created
    on a system a PID can get recycled or assigned to a non-Salt process.
    On Linux this fn checks to make sure the PID we are checking on is actually
    a Salt process.

    For non-Linux systems we punt and just return True
    Tr!Fz/procz/proc/z/cmdliner ssaltN)rr�platformZis_linuxr7rrrr�isfilerrr.r)rr!rrrrrr:}s(	
�&��r:)�__doc__�loggingrr+Zsalt.payloadrZsalt.utils.filesZsalt.utils.platformZsalt.utils.process�	getLogger�__name__r2rrr	r:rrrr�<module>s
I

Youez - 2016 - github.com/yon3zu
LinuXploit