From 4506875b4f2c7dd647911bb6cd3d6c671168f2e3 Mon Sep 17 00:00:00 2001 From: midoks Date: Wed, 6 Jul 2022 09:14:30 +0800 Subject: [PATCH 1/7] Update index.py --- plugins/php/index.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/php/index.py b/plugins/php/index.py index 1c062e83b..4ad244d4c 100755 --- a/plugins/php/index.py +++ b/plugins/php/index.py @@ -271,6 +271,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' From 26ba3b5c565eb94ced93e4bd4b04800ef6d767ca Mon Sep 17 00:00:00 2001 From: midoks Date: Wed, 6 Jul 2022 09:17:49 +0800 Subject: [PATCH 2/7] Update centos.sh --- scripts/update/centos.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 15ebb1e05c78bf32cfb6267654e34cd645a5d3b8 Mon Sep 17 00:00:00 2001 From: midoks Date: Wed, 6 Jul 2022 10:27:24 +0800 Subject: [PATCH 3/7] =?UTF-8?q?php=20systemd=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/php/conf/php-fpm.conf | 2 ++ plugins/php/index.py | 3 +++ .../php/init.d/{php.service.bak.tpl => php.service.52.tpl} | 5 ++--- plugins/php/init.d/php.service.tpl | 7 +++---- scripts/install/centos.sh | 1 + 5 files changed, 11 insertions(+), 7 deletions(-) rename plugins/php/init.d/{php.service.bak.tpl => php.service.52.tpl} (64%) 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 4ad244d4c..48cc6ab77 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) 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..d2ff7bebd 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 --nondaemonize --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 From 0b50803d8f0bed6a8f1d21d9ed9e4d4c11dd57b2 Mon Sep 17 00:00:00 2001 From: midoks Date: Wed, 6 Jul 2022 10:28:15 +0800 Subject: [PATCH 4/7] Update index.py --- plugins/php/index.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/php/index.py b/plugins/php/index.py index 48cc6ab77..b7a5f8634 100755 --- a/plugins/php/index.py +++ b/plugins/php/index.py @@ -308,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): From cc3cbe2047ca7670d0c302f44d6e8e6122e853c8 Mon Sep 17 00:00:00 2001 From: midoks Date: Wed, 6 Jul 2022 10:42:54 +0800 Subject: [PATCH 5/7] Update index.py --- plugins/openresty/index.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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] == '': From c3d74f1982483d9869ee074332712f36f11577c9 Mon Sep 17 00:00:00 2001 From: midoks Date: Wed, 6 Jul 2022 10:55:13 +0800 Subject: [PATCH 6/7] Update config_api.py --- class/core/config_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 009704cc3c4f91afe26eb8b9557a6633a0ca09ad Mon Sep 17 00:00:00 2001 From: midoks Date: Wed, 6 Jul 2022 11:02:29 +0800 Subject: [PATCH 7/7] Update php.service.tpl --- plugins/php/init.d/php.service.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/php/init.d/php.service.tpl b/plugins/php/init.d/php.service.tpl index d2ff7bebd..215ce629c 100644 --- a/plugins/php/init.d/php.service.tpl +++ b/plugins/php/init.d/php.service.tpl @@ -8,7 +8,7 @@ After=network.target [Service] PIDFile={$SERVER_PATH}/php/{$VERSION}/var/run/php-fpm.pid -ExecStart={$SERVER_PATH}/php/{$VERSION}/sbin/php-fpm --nondaemonize --fpm-config {$SERVER_PATH}/php/{$VERSION}/etc/php-fpm.conf +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