Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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:

  1. How do I make the WebLogic service attempt to start the MySQL service when it is down?
  2. 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?
share|improve this question

1 - Define mysql service as a dependency service when configuring xml manifest for weblogic service. This way, your weblogic will not be started as long as mysql service is not reported to be completely online. This seems logical, since your weblogic app would depend on the mysql service availability, it would not do unnecessary attempts to db connect/sql statement execution when mysql db service is down.

2 - Since the dependency service goes offline/degraded state, your weblogic service will also go offline and will not be running. So there is no chance for weblogic service to attempt to make mysql service back online while it has the chance, since itself is going into maintenance mode. More so, there is no guarantee for the weblogic to initiate after that since the mysql service is going into maintenance/offline/degraded mode, smf will mark weblogic service also degraded/offline and hence it cannot be used to start the mysql service. This can be a clear case of cyclical dependency, which should be resolved, by using a third module/cronjob/transient service to take care of these both services.

Now that it is clear that major dependency service is mysql to run online almost all the time for the availability and clean functioning of weblogic, I would suggest to employ a third module / script (like even a cronjob would do) which would monitor the states of mysql service as preferred priority and then weblogic service. It should take care of handling/executing the SMF healing commands incase any of the service goes down.

share|improve this answer

Better use manifold ask and configure service to create the xml file for you : http://code.google.com/p/manifold/

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.