diff --git a/scripts/servers/databases/mariadb/install_mariadb.py b/scripts/servers/databases/mariadb/install_mariadb.py index 4e2b94b..3a63ae3 100644 --- a/scripts/servers/databases/mariadb/install_mariadb.py +++ b/scripts/servers/databases/mariadb/install_mariadb.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python3 +#!/opt/pythonenv/bin/python3 -u import sys import subprocess diff --git a/scripts/system/install_git.py b/scripts/system/install_git.py index 70c37fc..98144dc 100644 --- a/scripts/system/install_git.py +++ b/scripts/system/install_git.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3 -u +#!/opt/pythonenv/bin/python3 -u # A script for install pzoo user diff --git a/scripts/system/install_php.py b/scripts/system/install_php.py index 803cd2b..622fd06 100644 --- a/scripts/system/install_php.py +++ b/scripts/system/install_php.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3 -u +#!/opt/pythonenv/bin/python3 -u # A script for install pzoo user diff --git a/scripts/system/install_python.sh b/scripts/system/install_python.sh index a3993c5..d080e7c 100644 --- a/scripts/system/install_python.sh +++ b/scripts/system/install_python.sh @@ -14,7 +14,7 @@ if [[ $DISTRO =~ ^Debian ]] || [[ $DISTRO =~ ^Ubuntu ]]; then sudo apt-get update apt install sudo - sudo apt-get -y install python3 python3-pip python3-venv libaugeas0 + sudo apt-get -y install python3 python3-full python3-pip python3-venv libaugeas0 elif [[ $DISTRO =~ ^NAME=\"Arch ]]; then @@ -74,7 +74,9 @@ sudo python3 -m venv /opt/pythonenv/ sudo /opt/pythonenv/bin/pip install --upgrade pip -echo "export PS_REAL=\$PS1 && source /opt/pythonenv/bin/activate && export PS1=\$PS_REAL" >> /etc/profile.d/zpythonenv.sh +#echo "export PS_REAL=\$PS1 && source /opt/pythonenv/bin/activate && export PS1=\$PS_REAL && export PYTHONUNBUFFERED=1" >> /etc/profile.d/zpythonenv.sh + +#echo "export PYTHONUNBUFFERED=1" >> /etc/profile.d/pythonenv.sh sleep 1 diff --git a/scripts/system/install_pzoo_stats.py b/scripts/system/install_pzoo_stats.py index a17c7d6..8a3c828 100644 --- a/scripts/system/install_pzoo_stats.py +++ b/scripts/system/install_pzoo_stats.py @@ -1,4 +1,4 @@ -#!/usr/bin/python3 -u +#!/opt/pythonenv/bin/python3 -u # A script for install pzoo user diff --git a/tasks/servers/databases/mysql/standalone_mysql.py b/tasks/servers/databases/mysql/standalone_mysql.py index 98381f3..6c903a2 100644 --- a/tasks/servers/databases/mysql/standalone_mysql.py +++ b/tasks/servers/databases/mysql/standalone_mysql.py @@ -83,7 +83,7 @@ class ServerTask(Task): arr_server=serverdb.set_conditions('WHERE ip=%s', [self.server]).select_a_row_where() if arr_server: - dbserver.insert({'server_id': arr_server['id']}) + dbserver.insert({'server_id': arr_server['id'], 'access_ip': self.data['ip']}) return True @@ -122,6 +122,9 @@ class ServerTask(Task): error=True if 'access_localhost' in post: + + self.data['ip']='' + ip_check=IpField('ip') ip_host=post['access_localhost'].strip()