Skip to content

Silence STDERR in Facter #883

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

Merged
merged 2 commits into from
Sep 16, 2016

Conversation

dennisdegreef
Copy link
Contributor

Currenly performing a puppet apply, the following output is shown

Info: Loading facts
160903 16:55:09 [Note] /usr/sbin/mysqld (mysqld 10.0.26-MariaDB-0+deb8u1) starting as process 6358 ...
Notice: Compiled catalog for foo.example.com in environment production in 1.52 seconds

This is due to Facter performing mysqld -V to determine the version as fact.

The output of this command alone is this:

$ sudo mysqld -V
mysqld  Ver 10.0.26-MariaDB-0+deb8u1 for debian-linux-gnu on x86_64 ((Debian))
160903 17:02:08 [Note] mysqld (mysqld 10.0.26-MariaDB-0+deb8u1) starting as process 7260 ...

Where the line with 'starting as process' is STDERR.

This diff redirects STDERR to /dev/null, since it probably contain any critical information (during a version check).

After applying this diff, the expected outcome is the same again

$ sudo mysqld -V 2>/dev/null
mysqld  Ver 10.0.26-MariaDB-0+deb8u1 for debian-linux-gnu on x86_64 ((Debian))

As well as within Puppet.

Info: Loading facts
Notice: Compiled catalog for foo.example.com in environment production in 1.52 seconds
Info: Applying configuration version '1472915111'

@eputnam
Copy link
Contributor

eputnam commented Sep 16, 2016

Thanks for the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants