From cf8c2f827eb01d34949b5af9806f89a1e0f85594 Mon Sep 17 00:00:00 2001 From: Johnny Wang Date: Mon, 17 Jul 2023 16:49:36 +0800 Subject: [PATCH] change: dist-check: close nginx using PID file instead of killall. (#916) --- util/dist-check | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/util/dist-check b/util/dist-check index ce63fcc..a24cd15 100755 --- a/util/dist-check +++ b/util/dist-check @@ -86,7 +86,7 @@ sh "sudo $make install"; sh "sudo cp /tmp/nginx.conf $prefix/nginx/conf/nginx.conf"; sh "$prefix/nginx/sbin/nginx -V 2>&1 |grep $ver"; sh "$prefix/nginx/sbin/nginx -V 2>&1 |grep -v 'stream_proxy'"; -#system "sudo killall nginx > /dev/null 2>&1"; +#system "[ -f '$prefix/nginx/logs/nginx.pid' ] && sudo kill \$(cat '$prefix/nginx/logs/nginx.pid') > /dev/null 2>&1"; sh "sudo $prefix/nginx/sbin/nginx"; sh "curl -si localhost/lua|grep $lua"; sh "curl -si localhost/lua|grep $ver"; @@ -108,7 +108,7 @@ sh "sudo $prefix/nginx/sbin/nginx -sstop"; #sh "$prefix/nginx/sbin/nginx -V 2>\&1", $ver; #sh "$prefix/nginx/sbin/nginx -V 2>\&1", "--with-stream", 1; #sh "$prefix/nginx/sbin/nginx -V 2>\&1", "--with-dtrace-probes"; -#system "sudo killall nginx > /dev/null 2>&1"; +#system "[ -f '$prefix/nginx/logs/nginx.pid' ] && sudo kill \$(cat '$prefix/nginx/logs/nginx.pid') > /dev/null 2>&1"; #sh "sudo $prefix/nginx/sbin/nginx"; #sh "curl -si localhost/lua|grep $lua"; #sh "curl -si localhost/lua|grep $ver"; @@ -129,7 +129,7 @@ sh "$prefix/nginx/sbin/nginx -V 2>&1 |grep $ver"; sh "$prefix/nginx/sbin/nginx -V 2>&1 |grep '\\--without-http_gzip_module'"; sh "$prefix/nginx/sbin/nginx -V 2>&1 |grep -v -q '\\--with-http_ssl_module'"; sh "$prefix/nginx/sbin/nginx -V 2>&1 |grep '\\--without-pcre'"; -system "sudo killall nginx > /dev/null 2>&1"; +system "[ -f '$prefix/nginx/logs/nginx.pid' ] && sudo kill \$(cat '$prefix/nginx/logs/nginx.pid') > /dev/null 2>&1"; if (0) { sh "sudo $prefix/nginx/sbin/nginx"; sh "curl -si localhost/lua|grep $lua"; @@ -152,7 +152,7 @@ sh "sudo $make install"; sh "sudo cp /tmp/nginx.conf $prefix/nginx/conf/nginx.conf"; sh "$prefix/nginx/sbin/nginx -V 2>&1 |grep $ver"; sh "$prefix/nginx/sbin/nginx -V 2>&1 |grep '\\--with-threads'"; -system "sudo killall nginx > /dev/null 2>&1"; +system "[ -f '$prefix/nginx/logs/nginx.pid' ] && sudo kill \$(cat '$prefix/nginx/logs/nginx.pid') > /dev/null 2>&1"; sh "sudo $prefix/nginx/sbin/nginx"; sh "curl -si localhost/lua|grep $lua"; sh "curl -si localhost/lua|grep $ver"; @@ -171,7 +171,7 @@ sh "sudo $make install > /dev/null"; sh "sudo cp /tmp/nginx.conf $prefix/nginx/conf/nginx.conf"; sh "$prefix/nginx/sbin/nginx -V 2>&1 |grep $ver"; #sh "$prefix/nginx/sbin/nginx -V 2>&1 |grep '\\--with-no-pool-patch'"; -system "sudo killall nginx > /dev/null 2>&1"; +system "[ -f '$prefix/nginx/logs/nginx.pid' ] && sudo kill \$(cat '$prefix/nginx/logs/nginx.pid') > /dev/null 2>&1"; sh "sudo $prefix/nginx/sbin/nginx"; sh "curl -si localhost/lua|grep $lua"; sh "curl -si localhost/lua|grep $ver"; @@ -190,7 +190,7 @@ sh "$make -j$jobs"; sh "sudo $make install"; sh "sudo cp /tmp/nginx.conf $prefix/nginx/conf/nginx.conf"; sh "$prefix/nginx/sbin/nginx -V 2>&1 |grep $ver"; -system "sudo killall nginx > /dev/null 2>&1"; +system "[ -f '$prefix/nginx/logs/nginx.pid' ] && sudo kill \$(cat '$prefix/nginx/logs/nginx.pid') > /dev/null 2>&1"; sh "sudo $prefix/nginx/sbin/nginx"; sh "curl -si localhost/lua|grep $lua"; sh "curl -si localhost/lua|grep $ver"; @@ -215,7 +215,7 @@ sh "sudo $make install"; sh "sudo cp /tmp/nginx.conf $prefix/nginx/conf/nginx.conf"; sh "$prefix/nginx/sbin/nginx -V 2>&1 |grep $ver"; sh "$prefix/nginx/sbin/nginx -V 2>&1 |grep '\\--with-debug'"; -system "sudo killall nginx > /dev/null 2>&1"; +system "[ -f '$prefix/nginx/logs/nginx.pid' ] && sudo kill \$(cat '$prefix/nginx/logs/nginx.pid') > /dev/null 2>&1"; sh "sudo $prefix/nginx/sbin/nginx"; sh "curl -si localhost/lua|grep $lua"; sh "curl -si localhost/lua|grep $ver"; @@ -234,7 +234,7 @@ sh "sudo $prefix/nginx/sbin/nginx -sstop"; #sh "sudo cp /tmp/nginx.conf $prefix/nginx/conf/nginx.conf"; #sh "$prefix/nginx/sbin/nginx -V 2>&1 |grep $ver"; #sh "$prefix/nginx/sbin/nginx -V 2>&1 |grep '\\--with-dtrace-probes'"; -#system "sudo killall nginx > /dev/null 2>&1"; +#system "[ -f '$prefix/nginx/logs/nginx.pid' ] && sudo kill \$(cat '$prefix/nginx/logs/nginx.pid') > /dev/null 2>&1"; #sh "sudo $prefix/nginx/sbin/nginx"; #sh "curl -si localhost/lua|grep $lua"; #sh "curl -si localhost/lua|grep $ver";