Codebase list debian-goodies / d8e275a
Add workaround to have checkrestart work in OpenVZ environments with patch provided by Ralf Jung (closes: #747003) Javier Fernandez-Sanguino 9 years ago
1 changed file(s) with 12 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
321321 process.links.append(data)
322322 elif field == 'n':
323323 # Remove the previous entry to check if this is something we should use
324 if data.startswith('/SYSV'):
324 if data.find('SYSV') >= 0:
325325 # If we find SYSV we discard the previous descriptor
326326 last = process.descriptors.pop()
327 elif data.startswith('/'):
327 elif data.startswith('/') or data.startswith('(deleted)/') or data.startswith(' (deleted)/'):
328328 last = process.descriptors.pop()
329
330 # If the data starts with (deleted) put it in the end of the
331 # file name, this is used to workaround different behaviour in
332 # OpenVZ systems, see
333 # https://bugzilla.openvz.org/show_bug.cgi?id=2932
334 if data.startswith('(deleted)'):
335 data = data[9:] + ' (deleted)'
336 elif data.startswith(' (deleted)'):
337 data = data[10:] + ' (deleted)'
338
329339 # Add it to the list of deleted files if the previous descriptor
330340 # was DEL or lsof marks it as deleted
331341 if re.compile("DEL").search(last) or re.compile("\(deleted\)").search(data) or re.compile("\(path inode=[0-9]+\)$").search(data):