diff --git a/plugins/supervisor/index.py b/plugins/supervisor/index.py index 7f6f10cd8..87cac9c3e 100755 --- a/plugins/supervisor/index.py +++ b/plugins/supervisor/index.py @@ -103,7 +103,8 @@ def initDreplace(): mw.writeFile(conf, conf_content) if os.path.exists(systemDir) and not os.path.exists(systemService): - supervisord_bin = mw.execShell('which supervisord')[0].strip() + supervisord_bin = mw.execShell( + 'source ' + mw.getServerDir() + '/mdserver-web/bin/activate' + '&& which supervisord')[0].strip() se_content = mw.readFile(systemServiceTpl) se_content = se_content.replace('{$SERVER_PATH}', service_path) se_content = se_content.replace('{$SUP_BIN}', supervisord_bin) diff --git a/plugins/supervisor/install.sh b/plugins/supervisor/install.sh index 6f8cbc2ca..fb2c57e13 100755 --- a/plugins/supervisor/install.sh +++ b/plugins/supervisor/install.sh @@ -16,6 +16,9 @@ OSNAME=`cat ${rootPath}/data/osname.pl` OSNAME_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'` + +source ${rootPath}/bin/activate + Install_app() { echo '正在安装脚本文件...' > $install_tmp @@ -28,7 +31,6 @@ Install_app() if [ "centos" == "$OSNAME" ] || [ "fedora" == "$OSNAME" ];then pip install supervisor elif [ "ubuntu" == "$OSNAME" ] || [ "debian" == "$OSNAME" ] ;then - pip install supervisor pip install supervisor else pip install supervisor