AlkantarClanX12
Current Path : /proc/self/root/usr/local/lsws/lsns/bin/__pycache__/ |
Current File : //proc/self/root/usr/local/lsws/lsns/bin/__pycache__/common.cpython-36.pyc |
3 �!gK! � @ sB d dl Z d dlZd dlZd dlZd dlZd dlZd dlT d dlmZ dZd Z dZ dZdZdZ eje Zde_d e_d d� Zdd � Zdd� Zdd� Zdd� Zdd� Zdd� Zd<dd�Zd=dd�Zdd� Zdd � Zd!d"� Zd#d$� Zd%d&� Z d'd(� Z!d)d*� Z"d+d*� Z"d,d-� Z#d.d/� Z$d0d1� Z%d2d3� Z&d4d5� Z'd6d7� Z(d8d9� Z)d:d;� Z*dS )>� N)�*)�PIPEz0.0.1� � � � z/usr/local/lswsc C s t jddd� d S )Nz%(asctime)s.%(msecs)03dz [%(levelname)s] %(message)sz%Y-%m-%d %H:%M:%S)�formatZdatefmtz3%(asctime)s.%(msecs)03d [%(levelname)s] %(message)s)�loggingZbasicConfig� r r �"/usr/local/lsws/lsns/bin/common.py�init_logging s r c C s t jS )N)�this� serverRootr r r r �server_root s r c C s | t _d S )N)r r )�rootr r r �set_server_root s r c C s t � d | S )Nz/lsns/conf/)r )�fileonlyr r r � get_conf_file s r c C s t � d | S )Nz /lsns/bin/)r )r r r r �get_bin_file s r c C s t j| � tjd� d S )Nr )r �error�sys�exit)�msgr r r �fatal_error! s r c C s dddddgS )N�cpu�io�iops�mem�tasksr r r r r �get_options% s r Fc C s | j � rdytjt| ��}W q� tk r` } z*|s@td| |f � tjd| |f � dS d }~X q�X nVytj| �}W nF tk r� } z*|s�td| |f � tjd| |f � dS d }~X nX |j t � k � r�|s�td|j t � f � tjd|j t � f � dS |dfS ) NzError getting UID for %s: %sFzError getting name for %s: %sz#Specified uid: %d < minimum uid: %dT)NF)NF)NF)�isdigit�pwd�getpwuid�int� Exceptionr r �debug�getpwnam�pw_uid�get_min_uid)Zparam�no_fatal� user_info�errr r r �get_user( s* r, c C s2 g }x(| D ] }t ||�\}}|r |j|� q W |S )N)r, �append)�uidsr) �usersZuidr* Zgotr r r � get_users@ s r0 c C s t jjd�rdS dS )Nz/etc/plesk-releaseTF)�os�path�existsr r r r � get_pleskH s r4 c C s t � r dS dS )Ni'