svcs -d 命令可列出指定服务依赖的服务实例。
此示例显示 system-repository 服务依赖的服务实例:
$ svcs -d system-repository STATE STIME FMRI online Sep_09 svc:/milestone/network:default online Sep_09 svc:/system/filesystem/local:default online Sep_09 svc:/system/filesystem/autofs:default
svcs -l 命令还列出指定服务依赖的服务。除了相关项的名称和状态以外,-l 选项输出还显示相关项的类型或分组以及相关项的 restart_on 属性值。在此示例中,其中两个相关项是必需相关项,一个是可选相关项。有关这些分组中的相关项如何影响相关服务的说明,请参见相关项分组。有关相关项的不同 restart_on 属性值如何影响相关服务的说明,请参见相关项分组。
$ svcs -l system-repository fmri svc:/application/pkg/system-repository:default name IPS System Repository enabled false state disabled next_state none state_time Mon Sep 09 18:42:28 2013 restarter svc:/system/svc/restarter:default manifest /lib/svc/manifest/application/pkg/pkg-system-repository.xml dependency require_all/error svc:/milestone/network:default (online) dependency require_all/none svc:/system/filesystem/local:default (online) dependency optional_all/error svc:/system/filesystem/autofs:default (online)
您还可以使用 svcprop 命令列出这些相关项。此表在不同的行中显示相关项的分组和 restart_on 值,不显示相关项的状态。
$ svcprop -g dependency system-repository:default network/entities fmri svc:/milestone/network:default network/grouping astring require_all network/restart_on astring error network/type astring service filesystem-local/entities fmri svc:/system/filesystem/local:default filesystem-local/grouping astring require_all filesystem-local/restart_on astring none filesystem-local/type astring service autofs/entities fmri svc:/system/filesystem/autofs:default autofs/grouping astring optional_all autofs/restart_on astring error autofs/type astring service