Улучшена getRunCommands

master3.4 3.4.0_beta3
Mike Hiretsky 9 years ago
parent a167a22bd0
commit c6e3e9a32a

@ -614,7 +614,7 @@ def removeFileWithEmptyDirectory(rmName, stopDirectory="/"):
stopDirectory=stopDirectory)
def getRunCommands(not_chroot=False):
def getRunCommands(not_chroot=False, chroot=None):
"""List run program"""
def getCmd(procNum):
cmdLineFile = '/proc/%s/cmdline'%procNum
@ -624,6 +624,10 @@ def getRunCommands(not_chroot=False):
root_link = '/proc/%s/root'%procNum
if os.readlink(root_link) != "/":
return ""
if chroot is not None:
root_link = '/proc/%s/root'%procNum
if os.readlink(root_link) != chroot:
return ""
return open(cmdLineFile,'r').read().strip()
except Exception as e:
pass

Loading…
Cancel
Save