# Commands output for execute/script resources

**URL:** <https://discourse.chef.io/t/commands-output-for-execute-script-resources/1616>\
**Category:** Chef Infra (archive)\
**Created:** [November 2, 2010, 2:55pm UTC](https://discourse.chef.io/t/commands-output-for-execute-script-resources/1616 "2010-11-02T14:55:57Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vladimir\_Girnet](https://avatars.discourse-cdn.com/v4/letter/v/e19b73/32.png) [@Vladimir\_Girnet](https://discourse.chef.io/u/Vladimir_Girnet)\
**Post date:** [November 2, 2010, 2:55pm UTC](https://discourse.chef.io/t/commands-output-for-execute-script-resources/1616/1 "2010-11-02T14:55:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Seth\_Falcon\_01](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/seth_falcon_01/32/429_2.png) [@Seth\_Falcon\_01](https://discourse.chef.io/u/Seth_Falcon_01)\
**Post date:** [November 2, 2010, 4:18pm UTC](https://discourse.chef.io/t/commands-output-for-execute-script-resources/1616/2 "2010-11-02T16:18:02Z")

</div>

Hi,

On Tue, Nov 2, 2010 at 7:55 AM, Vladimir Girnet  
[vgirnet@tacitknowledge.com](mailto: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

---

<div class="post-metadata">

**Author:** ![Alex\_Soto](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/alex_soto/32/673_2.png) [@Alex\_Soto](https://discourse.chef.io/u/Alex_Soto)\
**Post date:** [November 2, 2010, 5:25pm UTC](https://discourse.chef.io/t/commands-output-for-execute-script-resources/1616/3 "2010-11-02T17:25:02Z")

</div>

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](mailto: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

---

<div class="post-metadata">

**Author:** ![Brian\_McKelvey](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/brian_mckelvey/32/805_2.png) [@Brian\_McKelvey](https://discourse.chef.io/u/Brian_McKelvey)\
**Post date:** [November 2, 2010, 6:44pm UTC](https://discourse.chef.io/t/commands-output-for-execute-script-resources/1616/4 "2010-11-02T18:44:44Z")

</div>

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](mailto: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](mailto: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

---

<div class="post-metadata">

**Author:** ![Vladimir\_Girnet](https://avatars.discourse-cdn.com/v4/letter/v/e19b73/32.png) [@Vladimir\_Girnet](https://discourse.chef.io/u/Vladimir_Girnet)\
**Post date:** [November 2, 2010, 8:19pm UTC](https://discourse.chef.io/t/commands-output-for-execute-script-resources/1616/5 "2010-11-02T20:19:05Z")

</div>

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](mailto: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

---

<div class="post-metadata">

**Author:** ![Brian\_McKelvey](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/brian_mckelvey/32/805_2.png) [@Brian\_McKelvey](https://discourse.chef.io/u/Brian_McKelvey)\
**Post date:** [November 2, 2010, 3:28pm UTC](https://discourse.chef.io/t/commands-output-for-execute-script-resources/1616/6 "2010-11-02T15:28:29Z")

</div>

+1

Sent from my iPhone

On Nov 2, 2010, at 7:55 AM, Vladimir Girnet [vgirnet@tacitknowledge.com](mailto: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

---

<div class="post-metadata">

**Author:** ![Joshua\_Timberman](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/joshua_timberman/32/424_2.png) [@Joshua\_Timberman](https://discourse.chef.io/u/Joshua_Timberman)\
**Post date:** [November 2, 2010, 3:45pm UTC](https://discourse.chef.io/t/commands-output-for-execute-script-resources/1616/7 "2010-11-02T15:45:15Z")

</div>

-----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/](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-----

---

<div class="post-metadata">

**Author:** ![kallistec](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/kallistec/32/23_2.png) [@kallistec](https://discourse.chef.io/u/kallistec)\
**Post date:** [November 2, 2010, 4:16pm UTC](https://discourse.chef.io/t/commands-output-for-execute-script-resources/1616/8 "2010-11-02T16:16:43Z")

</div>

Ohai!

On Tue, Nov 2, 2010 at 8:45 AM, Joshua Timberman [joshua@opscode.com](mailto: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](http://tickets.opscode.com/browse/CHEF-1190)

Dan DeLeo

---

<div class="post-metadata">

**Author:** ![Jonathan\_Weiss](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/jonathan_weiss/32/840_2.png) [@Jonathan\_Weiss](https://discourse.chef.io/u/Jonathan_Weiss)\
**Post date:** [November 3, 2010, 9:15am UTC](https://discourse.chef.io/t/commands-output-for-execute-script-resources/1616/9 "2010-11-03T09:15:12Z")

</div>

> 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://blog.innerewut.de)  
[http://twitter.com/jweiss](http://twitter.com/jweiss)

---

<div class="post-metadata">

**Author:** ![kallistec](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/kallistec/32/23_2.png) [@kallistec](https://discourse.chef.io/u/kallistec)\
**Post date:** [November 3, 2010, 5:14pm UTC](https://discourse.chef.io/t/commands-output-for-execute-script-resources/1616/10 "2010-11-03T17:14:23Z")

</div>

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](mailto: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://blog.innerewut.de)  
> [http://twitter.com/jweiss](http://twitter.com/jweiss)
