Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/gunicorn/__pycache__/pidfile.cpython-39.pyc
Ðазад
a j�h5 � @ s, d dl Z d dlZd dlZG dd� de�ZdS )� Nc @ s8 e Zd ZdZdd� Zdd� Zdd� Zdd � Zd d� ZdS ) �Pidfilez� Manage a PID file. If a specific name is provided it and '"%s.oldpid" % name' will be used. Otherwise we create a temp file using os.mkstemp. c C s || _ d | _d S �N)�fname�pid)�selfr � r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/gunicorn/pidfile.py�__init__ s zPidfile.__init__c C s� | � � }|r2|t�� krd S d}t||| jf ��|| _tj�| j�}|rbtj�|�sbtd| ��t j |d�\}}t�|d| j �d�� | jr�t� || j� n|| _t�|� t�| jd� d S )Nz5Already running on PID %s (or pid file '%s' is stale)z'%s doesn't exist. Can't create pidfile.)�dirz%s zutf-8i� )�validate�os�getpid�RuntimeErrorr r �path�dirname�isdir�tempfile�mkstemp�write�encode�rename�close�chmod)r r Zoldpid�msgZfdir�fdr r r r �create s"