lib/chef/application/windows_service.rb in chef-10.34.6 vs lib/chef/application/windows_service.rb in chef-11.0.0.beta.0
- old
+ new
@@ -90,10 +90,13 @@
run_chef_client
Chef::Log.debug("Sleeping for #{Chef::Config[:interval]} seconds")
client_sleep Chef::Config[:interval]
+ rescue Chef::Application::Wakeup => e
+ Chef::Log.debug("Received Wakeup signal. Starting run.")
+ next
rescue SystemExit => e
raise
rescue Exception => e
Chef::Log.error("#{e.class}: #{e}")
Chef::Application.debug_stacktrace(e)
@@ -165,11 +168,11 @@
end
def configure_chef(startup_parameters)
# Bit of a hack ahead:
# It is possible to specify a service's binary_path_name with arguments, like "foo.exe -x argX".
- # It is also possible to specify startup parameters separately, either via the Services manager
+ # It is also possible to specify startup parameters separately, either via the the Services manager
# or by using the registry (I think).
# In order to accommodate all possible sources of parameterization, we first parse any command line
# arguments. We then parse any startup parameters. This works, because Mixlib::CLI reuses its internal
# 'config' hash; thus, anything in startup parameters will override any command line parameters that
@@ -213,10 +216,10 @@
(1..chunks).each do
return unless state == RUNNING
sleep chunk_length
end
end
-
+
end
end
end
# To run this file as a service, it must be called as a script from within