sfiggins
activity item
Nov 05
New Answer
java dependent service won't start after bootstrap
I ran into something similar recently using the tomcat cookbook. The tomcat problem appears on el6 systems, maybe el5 as well. In my case the service action ":start" conflicts with the template's ":restart" notification. On el6 the "service tomcat6 start" returns with a successful code, but tomcat6 is still initializing when it receives "service tomcat6 restart" and so the second service call returns an error, which causes the chef run to abort. The second time you run chef-client, tomcat is already running, so it isn't started, and the restart works properly. This is probably more of an issue with the init script returning prematurely, but it would be nice to have some way to route around that problem with chef. My initial pass at fixing this was to remove :start from the service definition. The template's restart is sufficient to start the service the first time it is run. But that means the service won't be started in future runs if it is found to not be running. I'm still looking for a better solution. See [COOK-1599](http://tickets.opscode.com/browse/COOK-1599 "COOK-1599")
more →