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