在 Oracle® Solaris 11.2 中管理系统服务

退出打印视图

更新时间: 2014 年 7 月
 
 

获得有关服务状态的更多信息

如果不指定参数,则 svcs -x 命令将提供有关以下服务实例的说明性信息:

  • 已启用但未运行的实例。

  • 阻止其他已启用服务运行的实例。

如果所有已启用的服务都处于运行状态,则 svcs -x 命令不生成任何输出。

在下面的示例中,pkg/depot 服务处于 maintenance 状态是因为其 start 方法失败。

$ svcs -x
svc:/application/pkg/depot:default (IPS Depot)
 State: maintenance since September 11, 2013 01:30:42 PM PDT
Reason: Start method exited with $SMF_EXIT_ERR_FATAL.
   See: http://support.oracle.com/msg/SMF-8000-KS
   See: pkg.depot-config(1M)
   See: /var/svc/log/application-pkg-depot:default.log
Impact: This service is not running.

输出建议参考 My Oracle Support 中的“预测性自我修复”知识文章、手册页和日志文件,以确定 start 方法失败的原因。有关查看日志文件的不同方法的信息,请参见查看服务日志文件。有关如何修复处于 maintenance 状态的服务的信息,请参见修复处于降级、脱机或维护状态的实例

在下面的示例中,print/server 服务具有未运行的相关服务。相关服务无法运行是因为 print/server 服务处于禁用状态。

$ svcs -x
svc:/application/print/server:default (LP print server)
 State: disabled since Fri Mar 08 14:42:32 2013
Reason: Disabled by an administrator.
   See: http://sun.com/msg/SMF-8000-05
   See: lpsched(1M)
Impact: 2 dependent services are not running.  (Use -v for list.)
$ svcs -xv
svc:/application/print/server:default (LP print server)
 State: disabled since Fri Mar 08 14:42:32 2013
Reason: Disabled by an administrator.
   See: http://sun.com/msg/SMF-8000-05
   See: man -M /usr/share/man -s 1M lpsched
Impact: 2 dependent services are not running:
        svc:/application/print/rfc1179:default
        svc:/application/print/ipp-listener:default
$ svcs -D print/server
STATE          STIME    FMRI
online         Mar_08   svc:/milestone/multi-user:default
offline        Mar_08   svc:/application/print/ipp-listener:default
offline        Mar_08   svc:/application/print/rfc1179:default

如果为 svcs -x 命令指定的参数不满足本节开头所述的条件,则输出不针对实例状态显示任何原因,但是仍然显示可获得更多信息的资源。

$ svcs -x smb
svc:/network/smb:default (SMB properties)
 State: online since Thu Sep 12 19:16:56 2013
   See: smb(4)
   See: /var/svc/log/network-smb:default.log
Impact: None.