From 1ddab772e371ab1852cbaaac848db479b5ef6f24 Mon Sep 17 00:00:00 2001 From: Paul Wise Date: Tue, 6 Jan 2015 22:53:24 +0800 Subject: [PATCH] Skip processes that no longer exist --- modules/buildd/files/buildd-schroot-aptitude-kill | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/buildd/files/buildd-schroot-aptitude-kill b/modules/buildd/files/buildd-schroot-aptitude-kill index 74c4a02f5..9a4d72092 100755 --- a/modules/buildd/files/buildd-schroot-aptitude-kill +++ b/modules/buildd/files/buildd-schroot-aptitude-kill @@ -44,7 +44,13 @@ for p in psutil.process_iter(): if parent is None: continue if parent.name != 'schroot': continue # - rootdir = os.readlink('/proc/%d/root'%(p.pid,)) + try + rootdir = os.readlink('/proc/%d/root'%(p.pid,)) + except OSError as e: + if e.errno == errno.ENOENT: + continue + else: + raise e if not rootdir.startswith('/var/lib/schroot/mount'): continue # used = p.get_memory_info().vms -- 2.20.1