Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fallback for missing /proc/1/mounts #1172

Merged
merged 3 commits into from
Nov 30, 2018
Merged

Add fallback for missing /proc/1/mounts #1172

merged 3 commits into from
Nov 30, 2018

Conversation

SuperQ
Copy link
Member

@SuperQ SuperQ commented Nov 26, 2018

On some systems, /proc/1/mounts is hidden from non-root users due to
the hidepid procfs feature. Attempt to fallback to /proc/mounts if
/proc/1/mounts is not found.

Fixes: #1171

Signed-off-by: Ben Kochie [email protected]

@brian-brazil
Copy link
Contributor

👍

Is it sane to add a regression test for this? Might also want a debug log.

@SuperQ
Copy link
Member Author

SuperQ commented Nov 26, 2018

Yea, we can make an extra fixtures directory for this.

On some systems, `/proc/1/mounts` is hidden from non-root users due to
the `hidepid` procfs feature. Attempt to fallback to `/proc/mounts` if
`/proc/1/mounts` is not found.

Signed-off-by: Ben Kochie <[email protected]>
Signed-off-by: Ben Kochie <[email protected]>
Signed-off-by: Ben Kochie <[email protected]>
@brian-brazil
Copy link
Contributor

👍

@SuperQ SuperQ merged commit 4abc6fb into master Nov 30, 2018
@SuperQ SuperQ deleted the superq/hidepid branch November 30, 2018 13:01
SuperQ added a commit that referenced this pull request Nov 30, 2018
* Add fallback for missing /proc/1/mounts

On some systems, `/proc/1/mounts` is hidden from non-root users due to
the `hidepid` procfs feature. Attempt to fallback to `/proc/mounts` if
`/proc/1/mounts` is not found.

Signed-off-by: Ben Kochie <[email protected]>

* Add tests.

Signed-off-by: Ben Kochie <[email protected]>

* Add CHANGELOG entry.

Signed-off-by: Ben Kochie <[email protected]>
SuperQ added a commit that referenced this pull request Nov 30, 2018
* Add fallback for missing /proc/1/mounts

On some systems, `/proc/1/mounts` is hidden from non-root users due to
the `hidepid` procfs feature. Attempt to fallback to `/proc/mounts` if
`/proc/1/mounts` is not found.

Signed-off-by: Ben Kochie <[email protected]>

* Add tests.

Signed-off-by: Ben Kochie <[email protected]>

* Add CHANGELOG entry.

Signed-off-by: Ben Kochie <[email protected]>
simonmeggle added a commit to simonmeggle/node_exporter that referenced this pull request Feb 18, 2019
oblitorum pushed a commit to shatteredsilicon/node_exporter that referenced this pull request Apr 9, 2024
* Add fallback for missing /proc/1/mounts

On some systems, `/proc/1/mounts` is hidden from non-root users due to
the `hidepid` procfs feature. Attempt to fallback to `/proc/mounts` if
`/proc/1/mounts` is not found.

Signed-off-by: Ben Kochie <[email protected]>

* Add tests.

Signed-off-by: Ben Kochie <[email protected]>

* Add CHANGELOG entry.

Signed-off-by: Ben Kochie <[email protected]>
oblitorum pushed a commit to shatteredsilicon/node_exporter that referenced this pull request Apr 9, 2024
* Add fallback for missing /proc/1/mounts

On some systems, `/proc/1/mounts` is hidden from non-root users due to
the `hidepid` procfs feature. Attempt to fallback to `/proc/mounts` if
`/proc/1/mounts` is not found.

Signed-off-by: Ben Kochie <[email protected]>

* Add tests.

Signed-off-by: Ben Kochie <[email protected]>

* Add CHANGELOG entry.

Signed-off-by: Ben Kochie <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants