Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
midoks committed Oct 1, 2024
1 parent 069ecec commit 2f50a2f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions plugins/pgadmin/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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')

Expand Down
2 changes: 1 addition & 1 deletion plugins/pgadmin/init.d/pgadmin.service.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 2f50a2f

Please sign in to comment.