Issue #7019 has been updated by Ben Hughes.
Status changed from Unreviewed to Investigating
This is deliberate I'm afraid. From my reading of the code STDIN, OUT and ERR
are mapped to /dev/null on execution to avoid having to use IO#read on the
process which blocks.
My best recommendation would be to use something like the following:
<pre>
exec{ "apache2ctl conftest":
notfiy => Service["apache2":],
logoutout => on_failure,
....,
}
</pre>
Which would get you the output and not restart the service if it has errors.
----------------------------------------
Feature #7019: Display output of failed commands
https://projects.puppetlabs.com/issues/7019
Author: John Crenshaw
Status: Investigating
Priority: Normal
Assignee:
Category:
Target version:
Affected Puppet version:
Keywords:
Branch:
When a command is executed, Puppet silently discards output in almost all cases
(I think it is discarding stdout, and only displaying stderr?). A quick example:
Puppet gave me the following error:
`
err: /Stage[main]/Apache::Base/Service[apache]: Failed to call refresh: Could
not restart Service[apache]: Execution of '/etc/init.d/apache2 restart'
returned 1: at /etc/puppet/modules/apache/manifests/classes/apache-base.pp:65
`
To get the actual details of the problem, I have to manually run the command:
`
sudo /etc/init.d/apache2 restart
`
This gives me something more meaningful:
`
Syntax error on line 2 of /etc/apache2/sites-enabled/example.com:
Missing address for VirtualHost
Action 'configtest' failed.
The Apache error log may have more information.
`
Puppet should have displayed this information on its own when it detected that
there was an error.
--
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-bugs?hl=en.