Skip to content

Replace use of chpst for Ubuntu Resolute Raccoon (26.04) - #346

Merged
jorbaum merged 1 commit into
cloudfoundry:mainfrom
dlinsley:feature/resolute-chpst-removal
Sep 18, 2026
Merged

jorbaum merged 1 commit into
cloudfoundry:mainfrom
dlinsley:feature/resolute-chpst-removal

Conversation

@dlinsley

Copy link
Copy Markdown
Contributor

Description

Replace use of chpst with setpriv for Ubuntu Resolute Raccoon (26.04) stemcell compatibility.

Background

Ubuntu 26.04 ("Resolute Raccoon") removes the runit package from base stemcells as outlined in RFC-0058. Consequently, the chpst utility is no longer available, causing jobs invoking chpst on their startup path to fail.

Following the pattern implemented across Cloud Foundry releases (e.g., cloudfoundry/capi-release@ae70cef):

  • Added src/scripts/privdrop_utils.sh defining run_as_vcap backed by setpriv --reuid=vcap --regid=vcap --clear-groups --no-new-privs -- "$@".
  • Added unit tests in src/scripts/privdrop_utils_test.bats.
  • Updated packages/system-metrics-agent (spec and packaging) to include and install privdrop_utils.sh to ${BOSH_INSTALL_TARGET}/scripts/.
  • Updated jobs/loggr-system-metrics-agent/templates/ctl.erb to source privdrop_utils.sh from the package directory and launch system-metrics-agent with run_as_vcap.
  • Updated spec/jobs/loggr_system_metrics_agent_spec.rb to assert that ctl.erb sources privdrop_utils.sh, calls run_as_vcap, and no longer references chpst.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Testing performed?

  • Unit tests
  • Integration tests
  • Acceptance tests

Ran BOSH template RSpec suite (bundle exec rspec), confirming all 16 template tests pass with 0 failures:

  • Verified bin/ctl sources /var/vcap/packages/system-metrics-agent/scripts/privdrop_utils.sh.
  • Verified bin/ctl launches system-metrics-agent via run_as_vcap.
  • Verified bin/ctl contains no occurrences of chpst.

Checklist:

  • This PR is being made against the main branch, or relevant version branch
  • I have made corresponding changes to the documentation
  • I have added testing for my changes

If you have any questions, or want to get attention for a PR or issue please reach out on the #logging-and-metrics channel in the cloudfoundry slack

Ubuntu 26.04 removes the `runit` package, eliminating `chpst`.
Introduce `privdrop_utils.sh` with `run_as_vcap` backed by `setpriv`
in `system-metrics-agent` and use it in `ctl.erb`.
As per https://github.com/cloudfoundry/community/blob/main/toc/rfc/rfc-0058-resolute-raccoon-os.md#stemcell-change-removal-of-runit

@jorbaum jorbaum left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks solid and simple. Good idea to sync this with capi-release.

@jorbaum
jorbaum merged commit 80671d3 into cloudfoundry:main Sep 18, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

2 participants