17 scripts=[
'cmsPerfSuite.py',
18 'cmsRelvalreportInput.py',
23 'cmsIgProf_Analysis.py',
29 print "Looking for processes by user %s"%user
30 checkProcesses=subprocess.Popen(
"ps -efww|grep %s"%user,bufsize=4096,shell=
True,stdout=subprocess.PIPE,stderr=subprocess.STDOUT)
31 for line
in checkProcesses.stdout:
32 for executable
in scripts:
34 if executable
in line:
35 print "Found process %s"%line
38 kill_stdouterr=subprocess.Popen(
"kill %s"%PID,shell=
True,stdout=subprocess.PIPE, stderr=subprocess.STDOUT).stdout.read()
45 checkProcesses=subprocess.Popen(
"ps -efww|grep %s"%user,bufsize=4096,shell=
True,stdout=subprocess.PIPE,stderr=subprocess.STDOUT)
46 for line
in checkProcesses.stdout:
47 for executable
in scripts:
48 if executable
in line:
49 print "Something funny going on! It seems I could not kill process:\n%s"%line
53 print "Finally killed all jobs!"