Skip to content

Instantly share code, notes, and snippets.

@maxmanders
Created November 13, 2012 11:05
Show Gist options
  • Save maxmanders/4065239 to your computer and use it in GitHub Desktop.
Save maxmanders/4065239 to your computer and use it in GitHub Desktop.
Delay start of NSSM created service until the end of a Chef run.
nssm_service "chef-client" do
application "C:/opscode/chef/embedded/bin/ruby.exe"
options "C:/opscode/chef/bin/chef-client -C C:/chef/client.rb -i 1800 -s 120"
end
service "chef-client" do
action :nothing
only_if { WMI::Win32_Service.find(:all).collect{|s| s.name}.include?("chef-client") }
end
template "C:\\opscode\\chef\\service-trigger.txt" do
source "service-trigger.txt.erb"
notifies :restart, "service[chef-client]"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment