Issue #2552 has been updated by Markus Roberts.
Status changed from Accepted to Needs design decision
Assigned to changed from Markus Roberts to Luke Kanies
Here's what I've got so far:
@Puppet::Util::execute@ is failing because it is being passed a non-Array and
will only accept an Array; this appears to be a trap inserted in an empirical
refactor, presumably motivated by concern over shell-expansion-injection in
@Kernel#exec@ which is called a few lines down if it is passed a single String
argument.
If that is the purpose, I note in passing that it's not entirely effective, as
passing @Puppet::Util::execute@ a one element Array would still result in shell
expansion in @kernel#e...@.
The non-Array value being passed into @Puppet::Util::execute@ in this case
appears (from code inspection; I haven't reproduced the bug) to be @false@, on
the following assumptions:
# @@resource[:status] is neither @false@ or @nil@
# @@resource[:hasstatus]@ is not @:true@ (notice this is a Symbol)
The first condition causes @ucommand@ to be called in the base service
implementation of @status@:
<pre>
# Check if the process is running. Prefer the 'status' parameter,
# then 'statuscmd' method, then look in the process table. We give
# the object the option to not return a status command, which might
# happen if, for instance, it has an init script (and thus responds to
# 'statuscmd') but does not have 'hasstatus' enabled.
def status
if @resource[:status] or (
self.respond_to?(:statuscmd) and self.statuscmd
)
# Don't fail when the exit status is not 0.
output = ucommand(:status, false)
if $? == 0
return :running
else
return :stopped
end
elsif pid = self.getpid
self.debug "PID is %s" % pid
return :running
else
return :stopped
end
end
</pre>
While the second causes the init-style service implementation of @statuscmd@ to
return @false@ when called from within @ucommand@:
<pre>
# If it was specified that the init script has a 'status' command, then
# we just return that; otherwise, we return false, which causes it to
# fallback to other mechanisms.
def statuscmd
if @resource[:hasstatus] == :true
return [self.initscript, :status]
else
return false
end
end
</pre>
At this point I'm needing guidance as to what is considered "correct" in this
sequence in order to determine which part should be changed to restore harmony.
My inclination would be to move the @:hasstatus@ test out of @statuscmd@ and
make it a normal boolean rather than a Symbol, but I fear there may be some
reason I'm not seeing for things having been done that way in the first place.
----------------------------------------
Bug #2552: execute fails
http://projects.reductivelabs.com/issues/2552
Author: Sam Rowe
Status: Needs design decision
Priority: High
Assigned to: Luke Kanies
Category: service
Target version: 0.25.0
Complexity: Unknown
Affected version: 0.25.0rc1
Keywords:
Running a 299eadb7d903d250c8340049bd78611f0c705920 RHEL 5 client against a
server running with Markus' branch which fixes #2493
(ffe6bb837b56ecaf5a50f26550c0e11c707345dc). We get a lot of these:
<pre>
/usr/lib/site_ruby/1.8/puppet/util.rb:250:in `execute'
/usr/lib/site_ruby/1.8/puppet/provider/service/base.rb:123:in `texecute'
/usr/lib/site_ruby/1.8/puppet/provider/service/base.rb:137:in `ucommand'
/usr/lib/site_ruby/1.8/puppet/provider/service/base.rb:64:in `status'
/usr/lib/site_ruby/1.8/puppet/type/service.rb:68:in `retrieve'
/usr/lib/site_ruby/1.8/puppet/type.rb:804:in `currentpropvalues'
/usr/lib/site_ruby/1.8/puppet/provider/nameservice.rb:242:in `inject'
/usr/lib/site_ruby/1.8/puppet/type.rb:802:in `each'
/usr/lib/site_ruby/1.8/puppet/type.rb:802:in `inject'
/usr/lib/site_ruby/1.8/puppet/type.rb:802:in `currentpropvalues'
/usr/lib/site_ruby/1.8/puppet/type.rb:790:in `retrieve'
/usr/lib/site_ruby/1.8/puppet/type.rb:719:in `evaluate'
/usr/lib/site_ruby/1.8/puppet/transaction.rb:60:in `apply'
/usr/lib/site_ruby/1.8/puppet/transaction.rb:249:in
`eval_children_and_apply_resource'
/usr/lib/site_ruby/1.8/puppet/util.rb:425:in `thinmark'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/core_ext/benchmark.rb:8:in
`realtime'
/usr/lib/site_ruby/1.8/puppet/util.rb:424:in `thinmark'
/usr/lib/site_ruby/1.8/puppet/transaction.rb:248:in
`eval_children_and_apply_resource'
/usr/lib/site_ruby/1.8/puppet/transaction.rb:205:in `eval_resource'
/usr/lib/site_ruby/1.8/puppet/transaction.rb:294:in `evaluate'
/usr/lib/site_ruby/1.8/puppet/util.rb:425:in `thinmark'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/core_ext/benchmark.rb:8:in
`realtime'
/usr/lib/site_ruby/1.8/puppet/util.rb:424:in `thinmark'
/usr/lib/site_ruby/1.8/puppet/transaction.rb:293:in `evaluate'
/usr/lib/site_ruby/1.8/puppet/transaction.rb:287:in `collect'
/usr/lib/site_ruby/1.8/puppet/transaction.rb:287:in `evaluate'
/usr/lib/site_ruby/1.8/puppet/resource/catalog.rb:139:in `apply'
/usr/lib/site_ruby/1.8/puppet/configurer.rb:142:in `run'
/usr/lib/site_ruby/1.8/puppet/util.rb:180:in `benchmark'
/usr/lib/ruby/gems/1.8/gems/activesupport-2.1.0/lib/active_support/core_ext/benchmark.rb:8:in
`realtime'
/usr/lib/site_ruby/1.8/puppet/util.rb:179:in `benchmark'
/usr/lib/site_ruby/1.8/puppet/configurer.rb:141:in `run'
/usr/lib/site_ruby/1.8/puppet/agent.rb:53:in `run'
/usr/lib/site_ruby/1.8/puppet/agent/locker.rb:21:in `lock'
/usr/lib/site_ruby/1.8/puppet/agent.rb:53:in `run'
/usr/lib/ruby/1.8/sync.rb:229:in `synchronize'
/usr/lib/site_ruby/1.8/puppet/agent.rb:53:in `run'
/usr/lib/site_ruby/1.8/puppet/agent.rb:130:in `with_client'
/usr/lib/site_ruby/1.8/puppet/agent.rb:51:in `run'
/usr/lib/site_ruby/1.8/puppet/application/puppetd.rb:103:in `onetime'
/usr/lib/site_ruby/1.8/puppet/application.rb:226:in `send'
/usr/lib/site_ruby/1.8/puppet/application.rb:226:in `run_command'
/usr/lib/site_ruby/1.8/puppet/application.rb:217:in `run'
/usr/lib/site_ruby/1.8/puppet/application.rb:306:in `exit_on_fail'
/usr/lib/site_ruby/1.8/puppet/application.rb:217:in `run'
/usr/sbin/puppetd:159
err: //redhat/Service[gpm]: Failed to retrieve current state of resource: Must
pass an array to execute()
</pre>
--
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://reductivelabs.com/redmine/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
-~----------~----~----~----~------~----~------~--~---