Jordan Brown (Sun) wrote:
> We have two services, one of which is dependent on the other.  Call them 
> A and B.  B requires that A is running.  (For that matter, I think that 
> A requires that B is running, but we'll ignore that for a moment.)

Woa ... that condition really could never exist, can it?

> If we want to restart both of them, we can do something like
> 
> svcadm disable -s B
> svcadm disable -s A
> svcadm enable -s A
> svcadm enable -s B
> 
> It sure seems like there should be an "svcadm restart" that does the 
> right thing.  I suspect that it's "svcadm restart A".  Does that do the 
> right thing?

I think this is true if:
  - a restart method is defined for service A
AND
  - the "restart_on" value expressed in the dependency relationship of B 
on A is of type "restart" or "refresh".  man smf(5) for this mess.

> If so, why?

Because the dependency attribute of B on A says to restart B if A is 
stopped due to error, non-error (admin restart) or refresh.

> My guess is that it
> 
> 1)  stops B because it depends on A
> 2)  stops A (because you asked for a restart of A)
> 3)  starts A (because you asked for a restart of A)
> 4)  starts B (because it's enabled and its dependencies are running)

CT

Reply via email to