search_path: Add common elements from $PATH#138
Merged
Merged
Conversation
bootc
reviewed
Jul 12, 2026
7270264 to
96388fa
Compare
Previously, we only had to paths where we looked for binaries + `$PATH`. Those two paths were `/sbin` and `/usr/sbin`. This covers most binaries, but relying on $PATH is... unreliable. e.g. many people assume that `/opt/puppetlabs/bin` is available in `search_paths`. But this isn't guaranteed. It's added to `$PATH` by `/etc/profile.d/puppet-agent.sh`. So it's only available in interactive shells. This causes the following bug: https://github.com/voxpupuli/puppet-openvoxdb/blob/56261b7b5dda7211d610cf5b28b8356a7ab41b52/lib/facter/openvoxdb_version.rb#L5 When running `puppet agent -t`, this fact works and `puppetdb` is found at `/opt/puppetlabs/bin/puppetdb`. When running the puppet.service unit, `/etc/profile.d/puppet-agent.sh` isn't sourced so the fact is nil. And IMO this is a bug in OpenFact. The whole list is still prefixed by `$PATH`. Signed-off-by: Tim Meusel <tim@bastelfreak.de>
bootc
approved these changes
Jul 12, 2026
corporate-gadfly
approved these changes
Jul 12, 2026
jorhett
approved these changes
Jul 12, 2026
binford2k
approved these changes
Jul 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, we only had to paths where we looked for binaries +
$PATH. Those two paths were/sbinand/usr/sbin. This covers most binaries, but relying on $PATH is... unreliable. e.g. many people assume that/opt/puppetlabs/binis available insearch_paths. But this isn't guaranteed. It's added to$PATHby/etc/profile.d/puppet-agent.sh. So it's only available in interactive shells.This causes the following bug:
https://github.com/voxpupuli/puppet-openvoxdb/blob/56261b7b5dda7211d610cf5b28b8356a7ab41b52/lib/facter/openvoxdb_version.rb#L5
When running
puppet agent -t, this fact works andpuppetdbis found at/opt/puppetlabs/bin/puppetdb. When running the puppet.service unit,/etc/profile.d/puppet-agent.shisn't sourced so the fact is nil. And IMO this is a bug in OpenFact.The whole list is still prefixed by
$PATH.Short description
Checklist
I have:
Signed-off-byannotation to each of my commitsGenerated-byorAssisted-byannotations to each of my commits created with the help of an AI agent