Commit Graph

12 Commits (ca886f93165eb406026ecaa77d7b56d8adebab7c)

Author SHA1 Message Date
shirou 1499bf63a6 feat: drop darwin/i386 from README and Makefile 3 years ago
Lomanic 5439492ad9 [README] Update godoc links to /v3 and add godocs.io alternative 3 years ago
Jamie Strandboge 9e6e627ec8 [disk][linux] add HOST_PROC_MOUNTINFO, closes #1271
The changes to gopsutil for reading /proc/1/mountinfo affected
applications running under restricted environments that disallows access
to /proc/1/mountinfo. #1159 was filed for android but other restricted
environments are also affected (eg, snaps)). The fix for #1159 addressed
the application behavior to work under confinement for non-android as
well. However, depending on the system, the attempt to read
/proc/1/mountinfo could cause a sandbox denial in the logs which can be
quite noisy if using gopsutil as part of a monitoring solution that
polls often.

This introduces HOST_PROC_MOUNTINFO to force reading from the parent dir
of the specified path instead of first trying /proc/1. When unset,
retain the current behavior with fallback. This allows people, for
example, to set HOST_PROC_MOUNTINFO=/proc/self/mountinfo when gopsutil
is running under these restricted environments.

This change updates the private readMountFile() to use a root path
instead of a root subpath, and adjusts PartitionsWithContext() to set
the root path to /proc/1 initially and falling back to /proc/self. When
HOST_PROC_MOUNTINFO is not empty, set the root path to the parent
directory of HOST_PROC_MOUNTINFO.
3 years ago
Ville Skyttä 1e56c6f421 Spelling and grammar fixes 3 years ago
Ville Skyttä d92d114f90 [load][solaris] implement AvgWithContext 3 years ago
shirou 35e404b9b4 remove terminal for macOS on README 3 years ago
shirou 00ff5a1a07 change minimum version to 1.16 on README 3 years ago
shirou f029ac1904 add cwd to macOSX 3 years ago
lufia 0617d71557 [v3][cpu] add plan9 support 3 years ago
lufia 0eae055018 [v3][mem] add plan9 support 3 years ago
Ross Smith II 5f0e37d823
Fix minor typos, formatting tweaks 4 years ago
Yoshiki Shibukawa 05e51b6d4b convert README from reStructuredText to Markdown 4 years ago