Fix: Correct runit supervise directory permissions for node_exporter
-
Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA. As a benefit of being a GitLab Community Contributor, you receive complimentary access to GitLab Duo.
What does this MR do?
This MR addresses an issue where the node_exporter
could not collect runit
service metrics due to restrictive file permissions on supervise
directories.
To resolve this, I have updated the runit_service
provider to ensure that the .../supervise
and .../log/supervise
directories are always created with 0755
permissions. This allows the gitlab-prometheus
user to correctly read the service status files.
Testing:
- Added a new shared RSpec test (
a service with proper supervise directories
) to verify the0755
permissions. - Applied this test (hopefully) to all relevant services.
- Tested the changes locally:
root@97371f4d1587:/omnibus-gitlab# ls -l /opt/gitlab/sv/*/ | grep supervise
drwxr-xr-x 2 root root 4096 Sep 19 06:42 supervise
drwxr-xr-x 2 root root 4096 Sep 19 06:42 supervise
drwxr-xr-x 2 root root 4096 Sep 19 06:42 supervise
drwxr-xr-x 2 root root 4096 Sep 21 12:01 supervise
drwxr-xr-x 2 root root 4096 Sep 19 06:42 supervise
drwxr-xr-x 2 root root 4096 Sep 21 11:38 supervise
drwxr-xr-x 2 root root 4096 Sep 21 11:59 supervise
drwxr-xr-x 2 root root 4096 Sep 21 11:59 supervise
drwxr-xr-x 2 root root 4096 Sep 19 06:42 supervise
drwxr-xr-x 2 root root 4096 Sep 19 06:38 supervise
drwxr-xr-x 2 root root 4096 Sep 19 06:42 supervise
drwxr-xr-x 2 root root 4096 Sep 21 11:57 supervise
drwxr-xr-x 2 root root 4096 Sep 19 06:42 supervise
drwxr-xr-x 2 root root 4096 Sep 19 06:37 supervise
drwxr-xr-x 2 root root 4096 Sep 21 11:57 supervise
drwxr-xr-x 2 root root 4096 Sep 18 02:43 supervise
Related issues
Closes #9221 (closed)
Checklist
See Definition of done.
For anything in this list which will not be completed, please provide a reason in the MR discussion.
Required
-
MR title and description are up to date, accurate, and descriptive. -
MR targeting the appropriate branch. -
Latest Merge Result pipeline is green. -
When ready for review, MR is labeled workflowready for review per the Distribution MR workflow.
For GitLab team members
If you don't have access to this, the reviewer should trigger these jobs for you during the review process.
-
The manual Trigger:ee-package
jobs have a green pipeline running against latest commit. -
If config/software
orconfig/patches
directories are changed, make sure thebuild-package-on-all-os
job within theTrigger:ee-package
downstream pipeline succeeded. -
If you are changing anything SSL related, then the Trigger:package:fips
manual job within theTrigger:ee-package
downstream pipeline must succeed. -
If CI configuration is changed, the branch must be pushed to dev.gitlab.org
to confirm regular branch builds aren't broken.
Expected (please provide an explanation if not completing)
-
Test plan indicating conditions for success has been posted and passes. -
Documentation created/updated. -
Tests added. -
Integration tests added to GitLab QA. -
Equivalent MR/issue for the GitLab Chart opened. -
Validate potential values for new configuration settings. Formats such as integer 10
, duration10s
, URIscheme://user:passwd@host:port
may require quotation or other special handling when rendered in a template and written to a configuration file.
Closes #9221 (closed)
Edited by Hristiyan Ivanov