Commands output for execute/script resources

Hi,

Sometimes it is required to see output of a command or a script. I know that
"-l debug" will display it, but it will also display a lot of non-required
debug information.

Is there a way to display output of a specific “execute”, “package” or
"script/bash" resources, except debug mode?

Is it possible to add for “execute”, “package” and “script/bash” resources a
new option “output”, which is by default false, but can be set to true to
display execution results?

Thanks,
Vladimir Girnet

Hi,

On Tue, Nov 2, 2010 at 7:55 AM, Vladimir Girnet
vgirnet@tacitknowledge.com wrote:

Sometimes it is required to see output of a command or a script. I know that
"-l debug" will display it, but it will also display a lot of non-required
debug information.

Is there a way to display output of a specific "execute", "package" or
"script/bash" resources, except debug mode?

Is it possible to add for "execute", "package" and "script/bash" resources a
new option "output", which is by default false, but can be set to true to
display execution results?

Is it that you want to process the output of a resource or just see it
in the logs in more detail?
If I'm understanding right, you just want the output to appear in the
log. I'd like to understand a bit more on the motivation. Is this
for debugging, but where debug -l produces too much info or for
another purpose?

  • seth

I'd like to see:

  • the ability to turn on the command output when the command fails instead of the error message Dan mentioned
  • when you tell it to ignore a non-zero result code, I'd like to not display the output

On Nov 2, 2010, at 9:18 AM, Seth Falcon wrote:

Hi,

On Tue, Nov 2, 2010 at 7:55 AM, Vladimir Girnet
vgirnet@tacitknowledge.com wrote:

Sometimes it is required to see output of a command or a script. I know that
"-l debug" will display it, but it will also display a lot of non-required
debug information.

Is there a way to display output of a specific "execute", "package" or
"script/bash" resources, except debug mode?

Is it possible to add for "execute", "package" and "script/bash" resources a
new option "output", which is by default false, but can be set to true to
display execution results?

Is it that you want to process the output of a resource or just see it
in the logs in more detail?
If I'm understanding right, you just want the output to appear in the
log. I'd like to understand a bit more on the motivation. Is this
for debugging, but where debug -l produces too much info or for
another purpose?

  • seth

Also, it would be nice if there was some indication of what script is being executed that would show up in the log before the Script executes. I often use the script resource for compiling things, and the log doesn't display anything until the compilation is complete, so if you're watching the log, it feels like the process just hung instead of having an indication of what's going on.

Brian

Sent from my iPad

On Nov 2, 2010, at 10:25 AM, Alex Soto apsoto@gmail.com wrote:

I'd like to see:

  • the ability to turn on the command output when the command fails instead of the error message Dan mentioned
  • when you tell it to ignore a non-zero result code, I'd like to not display the output

On Nov 2, 2010, at 9:18 AM, Seth Falcon wrote:

Hi,

On Tue, Nov 2, 2010 at 7:55 AM, Vladimir Girnet
vgirnet@tacitknowledge.com wrote:

Sometimes it is required to see output of a command or a script. I know that
"-l debug" will display it, but it will also display a lot of non-required
debug information.

Is there a way to display output of a specific "execute", "package" or
"script/bash" resources, except debug mode?

Is it possible to add for "execute", "package" and "script/bash" resources a
new option "output", which is by default false, but can be set to true to
display execution results?

Is it that you want to process the output of a resource or just see it
in the logs in more detail?
If I'm understanding right, you just want the output to appear in the
log. I'd like to understand a bit more on the motivation. Is this
for debugging, but where debug -l produces too much info or for
another purpose?

  • seth

On 11/2/2010 6:18 PM, Seth Falcon wrote:

Hi,

On Tue, Nov 2, 2010 at 7:55 AM, Vladimir Girnet
vgirnet@tacitknowledge.com wrote:

Sometimes it is required to see output of a command or a script. I know that
"-l debug" will display it, but it will also display a lot of non-required
debug information.

Is there a way to display output of a specific "execute", "package" or
"script/bash" resources, except debug mode?

Is it possible to add for "execute", "package" and "script/bash" resources a
new option "output", which is by default false, but can be set to true to
display execution results?
Is it that you want to process the output of a resource or just see it
in the logs in more detail?
If I'm understanding right, you just want the output to appear in the
log. I'd like to understand a bit more on the motivation. Is this
for debugging, but where debug -l produces too much info or for
another purpose?

  • seth
    I'd like to see more details in the chef-client output or log file. Not
    just "running this task"...
    Why? We have multiple "execute" and "script" resources. And some of them
    will run for a long time without any output. Running the same command
    manually will display some output, this way informing me about progress.
    So, progress in log files/console is always good. It would be great
    to have an option to enable/disable it for particular resources.
    Also, I may need to view output from only one resource. I know all
    other resources are working well. Running chef-client in debug mode will
    display output from all resources.
    Another moment - if a resource will fail - we will see a ruby
    stacktrace. Only in debug mode we will see the actual error. What if we
    have a resource that will run for 5 minutes? I have to wait 5 minutes to
    see the ruby stack, then switch to debug mode to see the actual error. I
    think this one was discussed previously already. It will be great to
    display full output of a resource with stderr included if exit code is
    different from expected ( usually 0 ).

Thanks,
Vladimir Girnet

+1

Sent from my iPhone

On Nov 2, 2010, at 7:55 AM, Vladimir Girnet vgirnet@tacitknowledge.com wrote:

Hi,

Sometimes it is required to see output of a command or a script. I know that
"-l debug" will display it, but it will also display a lot of non-required
debug information.

Is there a way to display output of a specific "execute", "package" or
"script/bash" resources, except debug mode?

Is it possible to add for "execute", "package" and "script/bash" resources a
new option "output", which is by default false, but can be set to true to
display execution results?

Thanks,
Vladimir Girnet

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello!

On Nov 2, 2010, at 7:55 AM, Vladimir Girnet wrote:

Sometimes it is required to see output of a command or a script. I know that
"-l debug" will display it, but it will also display a lot of non-required
debug information.

Is there a way to display output of a specific "execute", "package" or
"script/bash" resources, except debug mode?

Is it possible to add for "execute", "package" and "script/bash" resources a
new option "output", which is by default false, but can be set to true to
display execution results?

This would be a gret feature. Would you please create a feature ticket in the CHEF project?

http://tickets.opscode.com/

Thank you!


Opscode, Inc
Joshua Timberman, Technical Evangelist
IRC, Skype, Twitter, Github: jtimberman

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (Darwin)

iEYEARECAAYFAkzQMgsACgkQO97WSdVpzT3UagCePUkp7hjmfzUBXQlY7tzOLE0q
WLgAoJcFPZ84rspIlp5MzouI+8hXFiY2
=Z46X
-----END PGP SIGNATURE-----

Ohai!

On Tue, Nov 2, 2010 at 8:45 AM, Joshua Timberman joshua@opscode.com wrote:

Hello!

On Nov 2, 2010, at 7:55 AM, Vladimir Girnet wrote:

Sometimes it is required to see output of a command or a script. I know that
"-l debug" will display it, but it will also display a lot of non-required
debug information.

Is there a way to display output of a specific "execute", "package" or
"script/bash" resources, except debug mode?

Are you guys mostly just interested in seeing the output when a
command fails, so that you get a more informative error message than
"expected command to exit 0 but got 1" or do you have another use case
in mind?

This would be a gret feature. Would you please create a feature ticket in the CHEF project?

If you're only interested in seeing the outputs when the command
fails, I've already filed a ticket here:

http://tickets.opscode.com/browse/CHEF-1190

Dan DeLeo

Are you guys mostly just interested in seeing the output when a
command fails, so that you get a more informative error message than
"expected command to exit 0 but got 1" or do you have another use case
in mind?

This would be great and is the reason we still run everything in debug
instead of info.

Jonathan

--
Jonathan Weiss
http://blog.innerewut.de
http://twitter.com/jweiss

I'm prioritizing CHEF-1190 as a blocker for 0.10 to make sure this
gets fixed by then. If any of you guys wanna help out writing the
patch, stop by #chef-hacking or start a thread on chef-dev.

Thanks,
Dan

On Wed, Nov 3, 2010 at 2:15 AM, Jonathan Weiss jw@innerewut.de wrote:

Are you guys mostly just interested in seeing the output when a
command fails, so that you get a more informative error message than
"expected command to exit 0 but got 1" or do you have another use case
in mind?

This would be great and is the reason we still run everything in debug
instead of info.

Jonathan

--
Jonathan Weiss
http://blog.innerewut.de
http://twitter.com/jweiss