You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gopsutil/disk
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
..
disk.go delete v2 directory, move v3 to top #1078 3 years ago
disk_aix.go gofumpt 3 years ago
disk_darwin.go gofumpt 3 years ago
disk_darwin_cgo.go gofumpt 3 years ago
disk_darwin_nocgo.go gofumpt 3 years ago
disk_fallback.go gofumpt 3 years ago
disk_freebsd.go refactor: remove unnecessary exec.LookPath calls 3 years ago
disk_freebsd_386.go gofumpt 3 years ago
disk_freebsd_amd64.go gofumpt 3 years ago
disk_freebsd_arm.go gofumpt 3 years ago
disk_freebsd_arm64.go gofumpt 3 years ago
disk_linux.go [disk][linux] add HOST_PROC_MOUNTINFO, closes #1271 3 years ago
disk_openbsd.go gofumpt 3 years ago
disk_openbsd_386.go gofumpt 3 years ago
disk_openbsd_amd64.go delete v2 directory, move v3 to top #1078 3 years ago
disk_openbsd_arm64.go gofumpt 3 years ago
disk_solaris.go refactor: remove unnecessary exec.LookPath calls 3 years ago
disk_test.go enable errorlint linter 3 years ago
disk_unix.go gofumpt 3 years ago
disk_windows.go gofumpt 3 years ago
iostat_darwin.c [mac] fix deprecated code in macOS Monterey 3 years ago
iostat_darwin.h [mac] fix deprecated code in macOS Monterey 3 years ago
types_freebsd.go gofumpt 3 years ago
types_openbsd.go gofumpt 3 years ago