Issue #2481 has been updated by James Turnbull.
<pre>
diff --git a/lib/puppet/provider/service/redhat.rb b/lib/puppet/provider/service
index 63a545d..fe2c98b 100755
--- a/lib/puppet/provider/service/redhat.rb
+++ b/lib/puppet/provider/service/redhat.rb
@@ -52,18 +52,18 @@ Puppet::Type.type(:service).provide :redhat, :parent => :ini
end
end
- def restart
+ def restartcmd
if @resource[:hasrestart] == :true
- service(@resource[:name], "restart")
+ [command(:service), @resource[:name], "restart"]
else
super
end
end
- def status
+ def statuscmd
if @resource[:hasstatus] == :true
begin
- service(@resource[:name], "status")
+ [command(:service), @resource[:name], "status"]
return :running
rescue
return :stopped
</pre>
----------------------------------------
Feature #2481: Override commands in redhat service provider
http://projects.reductivelabs.com/issues/2481
Author: Robin Bowes
Status: Ready for Testing
Priority: Normal
Assigned to:
Category: service
Target version: 0.26.0
Complexity: Unknown
Affected version: 0.24.8
Keywords:
Using puppet 0.24.8 from epel on CentOS 5.3
I want to override the status command for a service with provider => 'redhat',
but it doesn't seem to be possible.
If I change the provider to 'init' or 'base' I can specify the status command,
but I don't get the chkconfig integration that comes with the redhat service
provider.
This is my service definition that doesn't work:
<pre>
service { "service-redhat-httpd":
enable => "false",
ensure => "stopped",
hasrestart => "true",
hasstatus => "true",
name => "httpd",
status => "pgrep httpd -P 1",
require => Package[httpd],
}
</pre>
This definiition *does* work but has no chkconfig integration:
<pre>
service { "service-redhat-httpd":
ensure => stopped,
hasstatus => true,
name => "httpd",
start => '/sbin/service start httpd',
stop => '/sbin/service stop httpd',
status => "pgrep httpd -P 1",
provider => 'base',
require => Package[httpd],
}
</pre>
So, basically, I'd like to have the command-override capability added to the
redhat provider.
I've added a patch that seems to fix my specific issue.
R.
--
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
-~----------~----~----~----~------~----~------~--~---