Unexpected behavior (or bug) in "exists filesystem" on Linux

Dear Forum,
Sorry to bother you with the dummy question…

I expect the relevance below to evaluate to “False” as “/app” file system doesn’t exist. I observe the opposite…

[aleks@devctlvpltfrm81 SPECS]$ /opt/BESClient/bin/qna
Default masthead location, using /etc/opt/BESClient/actionsite.afxm
Unable to open masthead for FIPS mode, defaulting to disabled
Q: exists filesystem "/app"
A: True
T: 4142

Q: ^C
[aleks@devctlvpltfrm81 SPECS]$ df -h /app/
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/sysvg-root_lv
19G 16G 1.7G 91% /
[aleks@devctlvpltfrm81 SPECS]$

Thank you,
Aleksandr

what does this one do:
q: names of drives

or

q: names of filesystems

Apologies, I have missed your reply.

Thanks for the suggestions - both produce the expected results (“/app” is not on the list).

Q: names of drives
A: /
A: /proc
A: /sys
A: /dev/pts
A: /dev/shm
A: /boot
A: /opt
A: /opt/bmc
A: /tmp
A: /var
A: /proc/sys/fs/binfmt_misc
A: /var/lib/nfs/rpc_pipefs
T: 39046

Q: names of filesystems
A: /
A: /proc
A: /sys
A: /dev/pts
A: /dev/shm
A: /boot
A: /opt
A: /opt/bmc
A: /tmp
A: /var
A: /proc/sys/fs/binfmt_misc
A: /var/lib/nfs/rpc_pipefs
T: 195

Thank you,
Aleksandr

exist filesystem seems to return true if the directory exists. The statement below should report correctly:

exist filesystem whose (name of it = “/app”)

1 Like

When you say filesystem “/app” (https://developer.bigfix.com/relevance/reference/filesystem.html#filesystem-string-filesystem) the inspector ends up calling the UNIX “stat” on the path and finding the device in question that it is on. So as long as the file exists then the return value would be a filesystem (https://developer.bigfix.com/relevance/reference/filesystem.html) if it exists.

You could get the name of the filesystem by using https://developer.bigfix.com/relevance/reference/filesystem.html#name-of-filesystem-string like the following

Q: name of filesystem "/app"

And you should get the response “/” in your case

1 Like