SMF Cheatsheet

From Docupedia

Note: This page was recently imported from an old text source. It will be cleaned up and wikified as time permits. -- bklang

Solaris 10 service management with SMF: A Crash Course

Services in Solaris 10 are identified by a new mechanism known as an "FMRI" FMRI stands for Fault Management Resource Indicator, which is part of the larger Fault Management subsystem which is a new part of Solaris 10. Because Solaris 10's SMF can detect when a service has failed and then restart it, it's considered to be part of the Fault Management System.

An FMRI looks somewhat like a URL. For example, here is the FMRI for the SSH daemon:

svc:/network/ssh:default

The svc: identfies this FMRI as an SMF managed service. The path /network allow for grouping of network related services. The path can be more than one level deep (example: svc:/network/rpc/gss:default). Finally the :default at the end of the line defines the instance of the service. An instance is simply another copy of the service usually with different parameters or startup configuration. And example of this would be old network login mechanism. The "login" system has the ":eklogin", ":klogin", and ":rlogin" instances.

SMF has not forgotten about legacy services either. Because many vendors have not had a chance to update their software to use the new SMF scheme, SMF still looks in the traditional /etc/rcX.d locations. These scripts are executed at system startup and shutdown by the SMF Milestone system. Because these services lack an SMF configuration they cannot be managed by SMF administrative tools. However they still have FMRIs and can be inspected minimally with the svcs tool. An FMRI for a "legacy" service looks like this:

lrc:/etc/rc2_d/S73cachefs_daemon

Because they are "legacy" services not managed by SMF they must be disabled by removing or renaming the file from the directory referenced by the FMRI.

Here are a few handy commands for managing SMF services:

To see a list of running services:

# svcs

To see a list of FMRIs for all configured services on the system:

# svcs -a

To see a list of failed services and clues to the cause of the failure:

# svcs -vx

To reset a service marked as in "Maintenance mode"

# svcadm clear <fmri>

To enable a disabled service:

# svcadm enable <fmri>
# svcadm disable <fmri>