Chengzu Zhou(Ricky) wrote:
> Hi
>
> Suppose Service A depends on B, A should be down while B is down , Right?
Correct, A should be offline is B is disabled.
> Check this out. It doesn't work on mine.
> ---------------------------------------------------
> ricky at rickyzhou:~$ svcs -a | grep apache
> online 21:08:27 svc:/network/http:apache22
> ricky at rickyzhou:~$ clear
> ricky at rickyzhou:~$ svcs -d svc:/network/http:apache22
> STATE STIME FMRI
> online 17:21:48 svc:/system/filesystem/local:default
> online 17:21:53 svc:/system/filesystem/autofs:default
> online 21:08:26 svc:/milestone/network:default
> ricky at rickyzhou:~$ svcadm disable svc:/milestone/network:default
> ricky at rickyzhou:~$ svcs svc:/network/http:apache22
> STATE STIME FMRI
> online 21:08:27 svc:/network/http:apache22
> ricky at rickyzhou:~$ svcs -xv
> ricky at rickyzhou:~$
> ----------------------------------------------------
It works if you reboot the system. The dependency re-evaluation doesn't
always occur after a disable. It depends on the restart_on attribute
of the dependency group. smf(5) man page says:
Once running (online or degraded), if a service cited by a
require_all, require_any, or optional_all dependency is
stopped or refreshed, the SMF considers why the service was
stopped and the restart_on attribute of the dependency to
decide whether to stop the service.
| restart_on value
event | none error restart refresh
-------------------+------------------------------
stop due to error | no yes yes yes
non-error stop | no no yes yes
refresh | no no no yes
In your case, I suppose that the attribute is set to 'none' or 'error'.
You can run " svcs -l svc:/network/http:apache22 " to list the deps. and
their attributes.
-- Renaud