[chef] Re: RE: Re: starting background process on windows


Chronological Thread 
  • From: Daniel DeLeo < >
  • To:
  • Subject: [chef] Re: RE: Re: starting background process on windows
  • Date: Fri, 23 Aug 2013 09:16:06 -0700


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.

§