Codebase list debian-goodies / fa9a1e5
checkrestart: Properly error-out when calling pmap fails Nicolas Braud-Santoni 6 years ago
1 changed file(s) with 2 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
363363 def procfilescheck(blacklist = None, excludepidlist = None):
364364 # Use the underlying /proc file system to determine processes that
365365 # are using deleted files
366 from subprocess import check_output
366367 processes = {}
367368 # Get a list of running processes
368369 pids = [pid for pid in os.listdir('/proc') if pid.isdigit()]
385386 continue
386387
387388 # Get the list of memory mapped files using system pmap
388 for output in os.popen('pmap ' + pid).readlines():
389 for output in check_output(['pmap', pid]).splitlines():
389390 data = re.split('\s+', output.strip('\n'), 3)
390391 if len(data) == 4:
391392 f = data[3]