diff options
author | John Keiser <john@johnkeiser.com> | 2015-09-28 18:04:51 -0700 |
---|---|---|
committer | John Keiser <john@johnkeiser.com> | 2015-09-28 18:04:51 -0700 |
commit | 8f65f75b2ae48ed33cfce1853edcdcc1a949b9c3 (patch) | |
tree | 4f8943fab9d81c933cfb3684cf0b7081c3634308 /lib/chef/platform | |
parent | 41e0090b0c3c67dce353337c04162c9abff9606c (diff) | |
download | chef-8f65f75b2ae48ed33cfce1853edcdcc1a949b9c3.tar.gz |
Make service_providers return the providers
Diffstat (limited to 'lib/chef/platform')
-rw-r--r-- | lib/chef/platform/service_helpers.rb | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/chef/platform/service_helpers.rb b/lib/chef/platform/service_helpers.rb index 39457a5d17..8365141c6e 100644 --- a/lib/chef/platform/service_helpers.rb +++ b/lib/chef/platform/service_helpers.rb @@ -43,30 +43,34 @@ class Chef # different services is NOT a design concern of this module. # def service_resource_providers + providers = [] + if ::File.exist?(Chef.path_to("/usr/sbin/update-rc.d")) - service_resource_providers << :debian + providers << :debian end if ::File.exist?(Chef.path_to("/usr/sbin/invoke-rc.d")) - service_resource_providers << :invokercd + providers << :invokercd end if ::File.exist?(Chef.path_to("/sbin/insserv")) - service_resource_providers << :insserv + providers << :insserv end # debian >= 6.0 has /etc/init but does not have upstart if ::File.exist?(Chef.path_to("/etc/init")) && ::File.exist?(Chef.path_to("/sbin/start")) - service_resource_providers << :upstart + providers << :upstart end if ::File.exist?(Chef.path_to("/sbin/chkconfig")) - service_resource_providers << :redhat + providers << :redhat end if systemd_sanity_check? - service_resource_providers << :systemd + providers << :systemd end + + providers end def config_for_service(service_name) |