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.
On Aug 23, 2013, at 6:16 PM, Daniel DeLeo email@example.com wrote:
On Friday, August 23, 2013 at 8:58 AM, Florian Hehlen wrote:
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.
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