Katello/katello — pull request #631 by lzap (2012-09-11 14:26:38+00:00)
Title: 856220 - service-wait script improvement

We are facing two race condition issues with Puppet after we touched it.

The fix is basically for three possible issues:

1) The service-wait script was ignoring "restart", now it also waits when "restart" is called. Works with Postgres, Tomcat and Mongo.

2) We were using http://localhost:8080/ URL for Tomcat availability detection. Now we use https://localhost:8443/candlepin/status which is more accurate (Tomcat can be up while /candlepin context is not yet).

3) Mongo behaves strange - our availability detection loop using "mongo" command returns successfuly while Mongo does not accepting connections. This is strange since mongo command use TCP for communication (as well as pulp-migrate). I have added additional 5 seconds sleep after mongo starts.

I tested it, let's put this upstream for a while to put Puppet under some more testing.