Edit File: lvestats_server.cpython-311.pyc
� L( eH! � � � d dl mZ d dl mZ d dlZd dlZd dlZd dlZd dlZd dlZd dl Z d dl Z d dlmZ d dl mZmZ d dlmZmZ d dlmZ dZd a G d � de� � Zd� Zd � Zd� Zd� Zd� Zd� Zd� Zd� Zd� Z d� Z!d� Z"d� Z#dS )� )�print_function)�absolute_importN)�reboot_lock)�config�dbengine)�LVEVersionError�get_lve_version)� setup_loggingz /dev/null� c � � � e Zd Z� fd�Z� xZS )�EnvironmentExceptionc �d �� t t | � � � � � || _ d S )N)�superr �__init__�message)�selfr � __class__s ���/builddir/build/BUILDROOT/lve-stats-4.2.1-1.el8.x86_64/opt/cloudlinux/venv/lib/python3.11/site-packages/lvestats/lib/lvestats_server.pyr zEnvironmentException.__init__ s+ �� � �"�D�)�)�2�2�4�4�4������ )�__name__� __module__�__qualname__r � __classcell__)r s @r r r s8 �� � � � � �� � � � � � � � r r c �& � t r�t j � t � � re t t t � � � � � � � } t j | d� � | S # t t f$ r Y dS w xY wdS dS )z� Check if lvestats already running :return int|None: None - if no process found; pid - if some lvestats-server found r N) �PIDFILE�os�path�isfile�int�open�read�kill�IOError�OSError)�pids r �get_process_pidr&