I'm creating service manifests for MySQL and a WebLogic service that depends on the MySQL service. I want all of them to use the management model "wait" (run a process in the foreground). I have some questions about this setup.
First, how do I dictate the status of a service? For example, when I created MySQL scripts prior to using services, after launching the mysqld_safe script in the background, I would ping it until I got a response; I wanted to make sure it was ready before continuing. Now with the service, it immediately goes to "online" even though I'm not sure if it's actually ready or not.
In the case that there is no good solution for that question, I put the MySQL DB pinging in the WebLogic script itself, and the exit with a status of 1 after a certain number of attempts. However, the service will continually restart. How do I force the service to go into maintenance mode after a non-zero exit?
Finally, I got the dependencies working in so far as that the WebLogic service won't start without the MySQL service being online, but I have two questions regarding this:
- How do I make the WebLogic service attempt to start the MySQL service when it is down?
- When the WebLogic service is already online, how do I make it so that it is taken down if the MySQL service ever goes down?