[chef] Re: starting background process on windows


Chronological Thread 
  • From: Florian Hehlen < >
  • To:
  • Subject: [chef] Re: starting background process on windows
  • Date: Sat, 24 Aug 2013 09:52:44 +0200

Daniel,

Thanks for the links. I got over my initial issue with a simple Process.spawn followed by Process.detach. This is obviously not enough for a production environment. But at the moment I am in the startup phase of the project and getting up and going is more important than making things bullet-proof. 

I will definitely take a look at the cookbooks you suggest. I am still new to Ruby and have to admit struggle when looking at other people's code. This is part of why my first attempts were not working. I also find myself very alone in the windows/chef world which does not help when looking for online help.

cheers,
FLorian

On Aug 23, 2013, at 6:16 PM, Daniel DeLeo < "> > wrote:


On Friday, August 23, 2013 at 8:58 AM, Florian Hehlen wrote:

Brad,
 
Unless I miss-understand, this resource is for controlling applications that can already run as services. I have a plain java executable that I want to spawn and fork. I do not see how I can do this.
 
Cheers,
Florian

What you really _should_ do, is use something like runit, daemontools, systemd, upstart, etc. to manage the service. These options all provide a framework for starting/stopping the service, and restarting it if it crashes. Other people using your systems will have a standard way to check if the service is running and so on.

If you're not going to do that, then you need to create a wrapper script to properly daemonize your service on your own. In principle it's pretty simple, but there's a lot of little details you need to get right. Chef's daemonization code is here: https://github.com/opscode/chef/blob/master/lib/chef/daemon.rb For an example of daemonizing a java program, take a look at https://github.com/opscode/chef-solr

-- 
Daniel DeLeo





Archive powered by MHonArc 2.6.16.

§