diff --git a/class/core/config_api.py b/class/core/config_api.py index 3f676819a..d58386310 100755 --- a/class/core/config_api.py +++ b/class/core/config_api.py @@ -17,7 +17,7 @@ class config_api: # 进行中. # 兼容主流Linux系统 - __version = '0.8.6.3' + __version = '0.8.6.4' def __init__(self): pass diff --git a/plugins/openresty/index.py b/plugins/openresty/index.py index bc5f71de6..ead69db9f 100755 --- a/plugins/openresty/index.py +++ b/plugins/openresty/index.py @@ -207,7 +207,7 @@ def restyOp(method): data = mw.execShell('systemctl ' + method + ' openresty') if data[1] == '': return 'ok' - return 'fail' + return data[1] data = mw.execShell(file + ' ' + method) if data[1] == '': diff --git a/plugins/php/conf/php-fpm.conf b/plugins/php/conf/php-fpm.conf index 433896d70..004ea8e87 100644 --- a/plugins/php/conf/php-fpm.conf +++ b/plugins/php/conf/php-fpm.conf @@ -1,4 +1,6 @@ [global] +pid = run/php-fpm.pid +error_log = log/php-fpm.log include={$SERVER_PATH}/php/{$PHP_VERSION}/etc/php-fpm.d/*.conf php_value[auto_prepend_file]={$SERVER_PATH}/php/app_start.php \ No newline at end of file diff --git a/plugins/php/index.py b/plugins/php/index.py index 1c062e83b..b7a5f8634 100755 --- a/plugins/php/index.py +++ b/plugins/php/index.py @@ -256,6 +256,9 @@ def initReplace(version): systemDir = '/usr/lib/systemd/system' systemService = systemDir + '/php' + version + '.service' systemServiceTpl = getPluginDir() + '/init.d/php.service.tpl' + if version == '52': + systemServiceTpl = getPluginDir() + '/init.d/php.service.52.tpl' + if os.path.exists(systemDir) and not os.path.exists(systemService): service_path = mw.getServerDir() se_content = mw.readFile(systemServiceTpl) @@ -271,6 +274,9 @@ def phpOp(version, method): file = initReplace(version) if not mw.isAppleSystem(): + if method == 'stop' or method == 'restart': + mw.execShell(file + ' ' + 'stop') + data = mw.execShell('systemctl ' + method + ' php' + version) if data[1] == '': return 'ok' @@ -302,7 +308,9 @@ def restart(version): def reload(version): - return phpOp(version, 'restart') + if version == '52': + return phpOp(version, 'restart') + return phpOp(version, 'reload') def initdStatus(version): diff --git a/plugins/php/init.d/php.service.bak.tpl b/plugins/php/init.d/php.service.52.tpl similarity index 64% rename from plugins/php/init.d/php.service.bak.tpl rename to plugins/php/init.d/php.service.52.tpl index 9a02235e2..d837568e8 100644 --- a/plugins/php/init.d/php.service.bak.tpl +++ b/plugins/php/init.d/php.service.52.tpl @@ -8,9 +8,8 @@ After=network.target [Service] Type=forking -ExecStart={$SERVER_PATH}/php/{$VERSION}/sbin/php-fpm --daemonize --fpm-config {$SERVER_PATH}/php/{$VERSION}/etc/php-fpm.conf -ExecStop=/bin/kill -INT $MAINPID -ExecReload=/bin/kill -USR2 $MAINPID +ExecStart={$SERVER_PATH}/php/init.d/php{$VERSION} start +ExecStop={$SERVER_PATH}/php/init.d/php{$VERSION} stop PrivateTmp=false [Install] diff --git a/plugins/php/init.d/php.service.tpl b/plugins/php/init.d/php.service.tpl index 0d5beb87d..215ce629c 100644 --- a/plugins/php/init.d/php.service.tpl +++ b/plugins/php/init.d/php.service.tpl @@ -7,10 +7,9 @@ Description=The PHP {$VERSION} FastCGI Process Manager After=network.target [Service] -Type=forking -ExecStart={$SERVER_PATH}/php/init.d/php{$VERSION} start -ExecStop={$SERVER_PATH}/php/init.d/php{$VERSION} stop -ExecReload={$SERVER_PATH}/php/init.d/php{$VERSION} reload +PIDFile={$SERVER_PATH}/php/{$VERSION}/var/run/php-fpm.pid +ExecStart={$SERVER_PATH}/php/{$VERSION}/sbin/php-fpm --nodaemonize --fpm-config {$SERVER_PATH}/php/{$VERSION}/etc/php-fpm.conf +ExecReload=/bin/kill -USR2 $MAINPID PrivateTmp=false [Install] diff --git a/scripts/install/centos.sh b/scripts/install/centos.sh index 71b06ed81..adc375729 100755 --- a/scripts/install/centos.sh +++ b/scripts/install/centos.sh @@ -77,6 +77,7 @@ if [ "$?" != "0" ];then yum install -y dnf dnf-plugins-core dnf config-manager --set-enabled powertools yum install -y oniguruma oniguruma-devel + dnf upgrade -y libmodulemd fi yum install -y libzstd-devel diff --git a/scripts/update/centos.sh b/scripts/update/centos.sh index 322c4f4c8..ea3c46697 100755 --- a/scripts/update/centos.sh +++ b/scripts/update/centos.sh @@ -57,4 +57,4 @@ do done echo -e "start mw success" -/etc/init.d/mw default \ No newline at end of file +bash /etc/init.d/mw default \ No newline at end of file