diff --git a/plugins/pgadmin/init.d/pgadmin.service.tpl b/plugins/pgadmin/init.d/pgadmin.service.tpl index 0b6e54f6b..562842036 100644 --- a/plugins/pgadmin/init.d/pgadmin.service.tpl +++ b/plugins/pgadmin/init.d/pgadmin.service.tpl @@ -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/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/python3.10/site-packages/pgadmin4 pgAdmin4:app ExecReload=/bin/kill -USR2 $MAINPID PrivateTmp=false diff --git a/plugins/pgadmin/install.sh b/plugins/pgadmin/install.sh index f81e9eb99..c4eddd13f 100755 --- a/plugins/pgadmin/install.sh +++ b/plugins/pgadmin/install.sh @@ -59,7 +59,7 @@ Install_pgadmin() if version_lt "$P_VER" "3.8.0" ;then echo 'Python版本太低,无法安装' fi - PG_DIR=${serverPath}/pgadmin + PG_DIR=${serverPath}/pgadmin/run mkdir -p $PG_DIR echo "${1}" > ${serverPath}/pgadmin/version.pl @@ -89,6 +89,21 @@ Install_pgadmin() Uninstall_pgadmin() { cd ${rootPath} && python3 ${rootPath}/plugins/pgadmin/index.py stop + + if [ -f /usr/lib/systemd/system/pgadmin.service ];then + systemctl stop pgadmin + systemctl disable pgadmin + rm -rf /usr/lib/systemd/system/pgadmin.service + systemctl daemon-reload + fi + + if [ -f /lib/systemd/system/pgadmin.service ];then + systemctl stop pgadmin + systemctl disable pgadmin + rm -rf /lib/systemd/system/pgadmin.service + systemctl daemon-reload + fi + rm -rf ${serverPath}/pgadmin echo '卸载完成' } diff --git a/scripts/init.d/mw.tpl b/scripts/init.d/mw.tpl index 5223b5de8..4f6974215 100755 --- a/scripts/init.d/mw.tpl +++ b/scripts/init.d/mw.tpl @@ -429,7 +429,6 @@ mw_connect_mysql(){ mw_connect_pgdb(){ - if [ ! -d "${ROOT_PATH}/postgresql" ];then echo -e "postgresql not install!" exit 1