projects
/
mirror
/
dsa-puppet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
systemd: reload journal service upon refresh
[mirror/dsa-puppet.git]
/
modules
/
buildd
/
files
/
buildd-schroot-aptitude-kill
diff --git
a/modules/buildd/files/buildd-schroot-aptitude-kill
b/modules/buildd/files/buildd-schroot-aptitude-kill
index
9a4d720
..
c7bc36a
100755
(executable)
--- a/
modules/buildd/files/buildd-schroot-aptitude-kill
+++ b/
modules/buildd/files/buildd-schroot-aptitude-kill
@@
-34,17
+34,17
@@
except OSError, e:
if e.errno == errno.ENOENT:
sys.exit(0)
if e.errno == errno.ENOENT:
sys.exit(0)
-total_mem = psutil.
phymem_usage
().total
+total_mem = psutil.
virtual_memory
().total
cutoff_time = 60*10
for p in psutil.process_iter():
try:
cutoff_time = 60*10
for p in psutil.process_iter():
try:
- if p.name != 'aptitude': continue
- parent = p.parent
+ if p.name
()
!= 'aptitude': continue
+ parent = p.parent
()
if parent is None: continue
if parent is None: continue
- if parent.name != 'schroot': continue
+ if parent.name
()
!= 'schroot': continue
#
#
- try
+ try
:
rootdir = os.readlink('/proc/%d/root'%(p.pid,))
except OSError as e:
if e.errno == errno.ENOENT:
rootdir = os.readlink('/proc/%d/root'%(p.pid,))
except OSError as e:
if e.errno == errno.ENOENT:
@@
-54,11
+54,9
@@
for p in psutil.process_iter():
if not rootdir.startswith('/var/lib/schroot/mount'): continue
#
used = p.get_memory_info().vms
if not rootdir.startswith('/var/lib/schroot/mount'): continue
#
used = p.get_memory_info().vms
- if used < total_mem: continue
- #
cputime = p.get_cpu_times().user
cputime = p.get_cpu_times().user
- if cputime < cutoff_time: continue
+ if
used < total_mem and
cputime < cutoff_time: continue
#
p.kill()
#
p.kill()
- except psutil.
error.
NoSuchProcess:
+ except psutil.NoSuchProcess:
pass
pass