Jon Choate
2010-Jul-12 19:00 UTC
[Puppet Users] dpkg in puppet returns 2 but at command line returns 0
I have an exec defined as exec {"dpkg --configure -a": path => "/usr/bin:/bin", user => root } puppet complains: Exec[dpkg --configure -a]/returns: change from notrun to 0 failed: dpkg --configure -a returned 2 instead of one of [0] but when I run dpkg --configure -a outside puppet it returns 0. Has anyone ever seen this before or have any insights? thanks! -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Luke Kanies
2010-Jul-12 23:09 UTC
Re: [Puppet Users] dpkg in puppet returns 2 but at command line returns 0
On Jul 12, 2010, at 12:00 PM, Jon Choate wrote:> I have an exec defined as > > exec {"dpkg --configure -a": > path => "/usr/bin:/bin", > user => root > } > > puppet complains: > > Exec[dpkg --configure -a]/returns: change from notrun to 0 failed: > dpkg --configure -a returned 2 instead of one of [0] > > but when I run dpkg --configure -a outside puppet it returns 0. > > Has anyone ever seen this before or have any insights?It''s almost got to be something related to your environment or your access (i.e., the user you run the commands as). -- I hate to advocate drugs, alcohol, violence, or insanity to anyone, but they''ve always worked for me. -- Hunter S. Thompson --------------------------------------------------------------------- Luke Kanies -|- http://puppetlabs.com -|- +1(615)594-8199 -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Rohan McGovern
2010-Jul-12 23:17 UTC
Re: [Puppet Users] dpkg in puppet returns 2 but at command line returns 0
ext Jon Choate said:> I have an exec defined as > > exec {"dpkg --configure -a": > path => "/usr/bin:/bin", > user => root > } > > puppet complains: > > Exec[dpkg --configure -a]/returns: change from notrun to 0 failed: dpkg --configure -a returned 2 instead of one of [0] > > but when I run dpkg --configure -a outside puppet it returns 0. > > Has anyone ever seen this before or have any insights? >The last time someone reported a problem like this on the mailing list, it was because the command had to run a subcommand which was not in PATH. In particular, `dpkg --configure'' runs postinst scripts for packages and these might do absolutely anything... at the very least I would expect that /usr/sbin and /sbin probably need to be in PATH too :-) -- Rohan McGovern QA Engineer Qt Development Frameworks, Nokia -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Jon Choate
2010-Jul-13 20:53 UTC
Re: [Puppet Users] dpkg in puppet returns 2 but at command line returns 0
Thanks! adding /usr/sbin and /sbin seems to have fixed it. On Mon, Jul 12, 2010 at 7:17 PM, Rohan McGovern <rohan.mcgovern@nokia.com>wrote:> ext Jon Choate said: > > I have an exec defined as > > > > exec {"dpkg --configure -a": > > path => "/usr/bin:/bin", > > user => root > > } > > > > puppet complains: > > > > Exec[dpkg --configure -a]/returns: change from notrun to 0 failed: dpkg > --configure -a returned 2 instead of one of [0] > > > > but when I run dpkg --configure -a outside puppet it returns 0. > > > > Has anyone ever seen this before or have any insights? > > > > The last time someone reported a problem like this on the mailing list, > it was because the command had to run a subcommand which was not in > PATH. > > In particular, `dpkg --configure'' runs postinst scripts for packages > and these might do absolutely anything... at the very least I would > expect that /usr/sbin and /sbin probably need to be in PATH too :-) > -- > Rohan McGovern > QA Engineer > Qt Development Frameworks, Nokia >-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.