[chef] RE: Windows service


Chronological Thread 
  • From: David Leaver < >
  • To: " " < >
  • Subject: [chef] RE: Windows service
  • Date: Wed, 30 Nov 2011 20:53:58 +0000
  • Accept-language: en-NZ, en-US

From what I’ve seen you need to do the install job manually. There may be a better way to do this now, but this is how our stuff does it.

 

 

We install the win32-service ruby package and use it for “service is installed” detection.

(gem install win32-service --no-rdoc --no-ri --verbose --platform x86-mswin32)

 

Then we use this amazing snippet to install a service:

 

powershell "Install Service: SomethingGood" do

       code <<-EOH

              c:

              cd /WindowsServices/SomethingGood/

              ./Install.bat

              sc.exe failure SomethingGood reset= 0 actions= restart/60

       EOH

       not_if {Win32::Service.exists?("SomethingGood")}

end

 

Our Install.bat installs the service, contents depend on the application.

 

Cheers,
Dave.

 

From: Kendrick Martin [mailto:
Sent: Thursday, 1 December 2011 8:00 a.m.
To:
Subject: [chef] Windows service

 

So I see the Service resource has support for windows service. My question is, does it handle creating the service if it doesn’t exist? I have a dll I want to install as a service and then make sure it’s started. Do I need to create a custom SC command line to install the service?




Archive powered by MHonArc 2.6.16.

§