From 216a857cc24e88e6525c250bc457c4b9d930d404 Mon Sep 17 00:00:00 2001 From: Mr Chen Date: Tue, 19 Mar 2019 16:28:59 +0800 Subject: [PATCH] Update task.py --- task.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/task.py b/task.py index 7e151df61..21fb5dce9 100755 --- a/task.py +++ b/task.py @@ -387,7 +387,8 @@ def startPHPVersion(version): cgi = '/tmp/php-cgi-'+version + '.sock' pid = sdir+'/php/'+version+'/var/run/php-fpm.pid'; data = public.execShell("ps -ef | grep php/"+version+" | grep -v grep|grep -v python |awk '{print $2}'") - print data + if data[0] != '' : + os.system("ps -ef | grep php/"+version+" | grep -v grep|grep -v python |awk '{print $2}' | xargs kill ") time.sleep(0.5); if not os.path.exists(cgi): os.system('rm -f ' + cgi); if not os.path.exists(pid): os.system('rm -f ' + pid);