diff options
author | Jeremiah Snapp <jeremiah@opscode.com> | 2013-10-03 09:51:05 -0400 |
---|---|---|
committer | Jeremiah Snapp <jeremiah@opscode.com> | 2013-10-03 09:51:05 -0400 |
commit | 153e2967db7e412b93b77161bd9ed43403a6f9c6 (patch) | |
tree | 68c108c91595c4ffb01e266d0835405e33cbff33 | |
parent | 583a308c1548ae76d2e2066d7a8aa8fb4a1d479d (diff) | |
download | chef-jhs/CHEF-4587.tar.gz |
CHEF-4587 Windows service provider should treat all START_TYPEs != DISABLED as enabledjhs/CHEF-4587
Currently, the Windows service provider only treats "Automatic (Delayed Start)"
and "Automatic" START_TYPEs as an enabled service. It should also treat
"Manual" as an enabled service.
A "Manual" service is not a disabled service. A "Manual" service can be started
by another service that depends on it or by an application or by human
intervention.
If we want Chef to ensure a service is truly disabled then the service's
START_TYPE should be set to "Disabled".
-rw-r--r-- | lib/chef/provider/service/windows.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/chef/provider/service/windows.rb b/lib/chef/provider/service/windows.rb index ba51e53bed..4333e77869 100644 --- a/lib/chef/provider/service/windows.rb +++ b/lib/chef/provider/service/windows.rb @@ -42,7 +42,7 @@ class Chef::Provider::Service::Windows < Chef::Provider::Service @current_resource.service_name(@new_resource.service_name) @current_resource.running(current_state == RUNNING) Chef::Log.debug "#{@new_resource} running: #{@current_resource.running}" - @current_resource.enabled(start_type == AUTO_START) + @current_resource.enabled(start_type != DISABLED) Chef::Log.debug "#{@new_resource} enabled: #{@current_resource.enabled}" @current_resource end @@ -122,7 +122,7 @@ class Chef::Provider::Service::Windows < Chef::Provider::Service def disable_service if Win32::Service.exists?(@new_resource.service_name) - if start_type == AUTO_START + if start_type != DISABLED Win32::Service.configure( :service_name => @new_resource.service_name, :start_type => Win32::Service::DISABLED |