diff options
author | Michael Boelen <michael.boelen@cisofy.com> | 2019-09-13 12:47:39 +0300 |
---|---|---|
committer | Michael Boelen <michael.boelen@cisofy.com> | 2019-09-13 12:47:39 +0300 |
commit | 5c38a0bdb48b4d8f264931111eaefb4ad4b4500e (patch) | |
tree | a1cc1b7f2575cc3611e66b518fdd79975ac9ea24 /include/binaries | |
parent | 7d33353058258e0726075bfd952c77071f8e7fac (diff) |
Tests using lsof may ignore threads (if supported)
Diffstat (limited to 'include/binaries')
-rw-r--r-- | include/binaries | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/include/binaries b/include/binaries index 661e0d41..d8a28cfa 100644 --- a/include/binaries +++ b/include/binaries @@ -189,7 +189,15 @@ lsattr) LSATTRBINARY="${BINARY}"; LogText " Found known binary: lsattr (file attributes) - ${BINARY}" ;; lsblk) LSBLKBINARY="${BINARY}"; LogText " Found known binary: lsblk (block devices) - ${BINARY}" ;; lsmod) LSMODBINARY="${BINARY}"; LogText " Found known binary: lsmod (kernel modules) - ${BINARY}" ;; - lsof) LSOFBINARY="${BINARY}"; LogText " Found known binary: lsof (open files) - ${BINARY}" ;; + lsof) + LSOFBINARY="${BINARY}" + LogText " Found known binary: lsof (open files) - ${BINARY}" + DATA=$(${LSOFBINARY} -h 2>&1 | grep "\-K \[i\] list\|\(i\)gn tasKs") + if [ $? -eq 0 ]; then + LogText "Note: added -K i to ignore tasks on Linux" + LSOF_EXTRA_OPTIONS=" -K i" + fi + ;; lsvg) LSVGBINARY=${BINARY}; LogText " Found known binary: lsvg (volume manager) - ${BINARY}" ;; lvdisplay) LVDISPLAYBINARY="${BINARY}"; LogText " Found known binary: lvdisplay (LVM tool) - ${BINARY}" ;; lynx) LYNXBINARY="${BINARY}"; LYNXVERSION=$(${BINARY} -version | grep "^Lynx Version" | cut -d ' ' -f3); LogText "Found known binary: lynx (browser) - ${BINARY} (version ${LYNXVERSION})" ;; |