Issue #19379 has been updated by Charlie Sharpsteen.
Category set to exec
Status changed from Unreviewed to Accepted
Assignee set to Charlie Sharpsteen
Affected Puppet version changed from 2.7.14 to 3.1.0
Keywords changed from exec logoutput to logoutput
Hi Chris,
Just tested this against 2.6.14 on an Ubuntu box. It looks like Puppet always
logs the exit condition of an `exec` resource and `logoutput` only controls
logging of any actual output emitted by the command.
For example, when setting `logoutput` to true we see the output generated by
`echo` along with the exit status:
<pre>
# puppet apply -e 'exec{"/bin/echo hai": logoutput => true}'
notice: /Stage[main]//Exec[/bin/echo hai]/returns: hai
notice: /Stage[main]//Exec[/bin/echo hai]/returns: executed successfully
notice: Finished catalog run in 0.07 seconds
</pre>
But when setting it to `on_failure`, we only see the exit status:
<pre>
# puppet apply -e 'exec{"/bin/echo hai": logoutput => on_failure}'
notice: /Stage[main]//Exec[/bin/echo hai]/returns: executed successfully
notice: Finished catalog run in 0.08 seconds
</pre>
It definitely looks like the docs need to be improved in many ways along with
explicitly stating that the exit status and output of a command are logged
separately and `logoutput` only controls output logging.
----------------------------------------
Bug #19379: exec: logoutput=>on_error always logs
https://projects.puppetlabs.com/issues/19379#change-86777
Author: Chris Ritson
Status: Accepted
Priority: Normal
Assignee: Charlie Sharpsteen
Category: exec
Target version:
Affected Puppet version: 3.1.0
Keywords: logoutput
Branch:
We are using an exec construct to look for unwanted long-running processes and
kill them. This is currently logging everything as "notice" messages. In an
attempt to suppress this when it is not needed, I tried to use the logoutput
parameter in the exec. The documentation contains the following mutually
inconsistent statements:-
* Values are true, false, on_failure, and any legal log level
* Valid values are true, false, on_failure
Trying to use a legal syslog level either symbolically "info", info or 6 always
raises a compilation/syntax error from the master at run time. Setting this
parameter to "on_failure" or "false" always logs output even when this output
states that the command was successful. Our master is on 2.7.14, the specific
client I was testing on uses 2.6.16.
--
You have received this notification because you have either subscribed to it,
or are involved in it.
To change your notification preferences, please click here:
http://projects.puppetlabs.com/my/account
--
You received this message because you are subscribed to the Google Groups
"Puppet Bugs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-bugs?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.