This commit is contained in:
Mr Chen
2024-10-01 15:21:54 +08:00
parent 56a276f019
commit b76c525106
2 changed files with 14 additions and 10 deletions
+13 -9
View File
@@ -175,6 +175,16 @@ def delPort():
return True
def cleanNginxLog():
log_a = accessLog()
log_e = errorLog()
for i in [log_a, log_e]:
if os.path.exists(i):
cmd = "echo '' > " + i
mw.execShell(cmd)
def initReplace():
pma_dir = getServerDir() + "/pgadmin"
@@ -213,20 +223,14 @@ def initReplace():
mw.writeFile(systemService, content)
mw.execShell('systemctl daemon-reload')
def start():
initCfg()
openPort()
initReplace()
log_a = accessLog()
log_e = errorLog()
for i in [log_a, log_e]:
if os.path.exists(i):
cmd = "echo '' > " + i
mw.execShell(cmd)
cleanNginxLog()
mw.restartWeb()
return 'ok'
+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}/lib/python3.10/dist-packages/pgadmin4 pgAdmin4:app
ExecStart=gunicorn --bind unix:/tmp/pgadmin4.sock --workers=1 --threads=25 --chdir {$SERVER_PATH}/pgadmin/lib/python3.10/dist-packages/pgadmin4 pgAdmin4:app
ExecReload=/bin/kill -USR2 $MAINPID
PrivateTmp=false