This commit is contained in:
Mr Chen
2024-10-02 03:51:37 +08:00
parent 069ececfe1
commit 2f50a2ffa0
2 changed files with 9 additions and 1 deletions
+8
View File
@@ -175,6 +175,11 @@ def cleanNginxLog():
cmd = "echo '' > " + i
mw.execShell(cmd)
def getPythonName():
cmd = "ls /www/server/pgadmin/run/lib/ | grep python | cut -d \\ -f 1 | awk 'END {print}'"
data = mw.execShell(cmd)
return data[0].strip();
def initPgConfFile():
file_tpl = getPluginDir() + '/conf/config_local.py'
dst_file = getServerDir()+'/run/lib/python3.10/site-packages/pgadmin4/config_local.py'
@@ -225,6 +230,9 @@ def initReplace():
service_path = mw.getServerDir()
content = mw.readFile(systemServiceTpl)
content = content.replace('{$SERVER_PATH}', service_path)
content = content.replace('{$PY_VER}', getPythonName())
mw.writeFile(systemService, content)
mw.execShell('systemctl daemon-reload')
+1 -1
View File
@@ -8,7 +8,7 @@ Description=pgadmin service
After=network.target
[Service]
ExecStart=gunicorn --bind unix:/tmp/pgadmin4.sock --workers=1 --threads=25 --chdir {$SERVER_PATH}/pgadmin/run/lib/python3.10/site-packages/pgadmin4 pgAdmin4:app
ExecStart=gunicorn --bind unix:/tmp/pgadmin4.sock --workers=1 --threads=25 --chdir {$SERVER_PATH}/pgadmin/run/lib/{$PY_VER}/site-packages/pgadmin4 pgAdmin4:app
ExecReload=/bin/kill -USR2 $MAINPID
PrivateTmp=false