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

Correct Fact mysqld_version on FreeBSD #1654

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/facter/mysqld_version.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# frozen_string_literal: true

Facter.add('mysqld_version') do
confine { Facter::Core::Execution.which('mysqld') || Facter::Core::Execution.which('/usr/libexec/mysqld') }
confine { Facter::Core::Execution.which('mysqld') || Facter::Core::Execution.which('/usr/libexec/mysqld') || Facter::Core::Execution.which('/usr/local/libexec/mysqld') }
Copy link
Collaborator

Choose a reason for hiding this comment

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

mhm this becomes a bit messy. Do you know if we can set PATH for the which() method? Or is it a bug that it doesn't already check in /usr/libexec/?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know if there is a better way like setting a PATH before. If someone find a proper solution : that's ok to me.

setcode do
# Add /usr/libexec to PATH to find mysqld command
Facter::Core::Execution.execute('env PATH=$PATH:/usr/libexec mysqld --no-defaults -V 2>/dev/null')
Facter::Core::Execution.execute('env PATH=$PATH:/usr/libexec:/usr/local/libexec mysqld --no-defaults -V 2>/dev/null')
end
end
Loading