电脑技术学习

Solaris10 SMF服务管理概要

dn001

  Usage: svCADm [-v] [cmd [args ... ]]

  svcadm enable [-rst] ... - enable and online service(s)

  svcadm disable [-st] ... - disable and offline service(s)

  svcadm restart ... - restart specifIEd service(s)

  svcadm refresh ... - re-read service configuration

  svcadm mark [-It] ... - set maintenance state

  svcadm clear ... - clear maintenance state

  svcadm milestone [-d] - advance to a service milestone

  Services can be specified using an FMRI, abbreviation, or fnmatch(5)

  pattern, as shown in these examples for svc:/network/smtp:sendmail

  svcadm svc:/network/smtp:sendmail

  svcadm network/smtp:sendmail

  svcadm network/*mail

  svcadm network/smtp

  svcadm smtp:sendmail

  svcadm smtp

  svcadm sendmail

  SMF服务排错

  使用svcs -xv可以查找未正常启动的服务。SMF对每个服务实例都在/var/svc/log目录创建了一个和服务FMRI对应的日志文件,比如apache2服务的FMRI为svc:/network/http:apache2,那么apache2服务状态变化的日志存放在名为network-http:apache2.log的文件中,

  如运行以下命令

  -bash-3.00# ls -l /var/svc/log |grep network

  -rw-r--r-- 1 root root 534 Feb 9 00:08 milestone-network:default.log

  -rw-r--r-- 1 root root 77 Jan 30 15:25 network-dns-client:default.log

  -rw-r--r-- 1 root root 169 Jan 30 15:27 network-dns-server:default.log

  -rw-r--r-- 1 root root 803 Feb 13 01:17 network-http:apache2.log

标签: