Description

The svcs command displays information about service instances as recorded in the service configuration repository.

The first form of this command prints one-line status listings for service instances specified by the arguments. Each instance is listed only once. With no arguments, all enabled service instances, even if temporarily disabled, are listed with the columns indicated below.

The second form prints one-line status listings for the dependencies or dependents of the service instances specified by the arguments.

The third form prints detailed information about specific services and instances.

The fourth form explains the states of service instances. For each argument, a block of human-readable text is displayed which explains what state the service is in, and why it is in that state. With no arguments, problematic services are described.

Error messages are printed to the standard error stream.

The output of this command can be used appropriately as input to the svcadm(1M) command.

Options

The following options are supported:

-?

Displays an extended usage message, including column specifiers.

-a

Show all services, even disabled ones. This option has no effect if services are selected.

-d

Lists the services or service instances upon which the given service instances depend.

-D

Lists the service instances that depend on the given services or service instances.

-H

Omits the column headers.

-l

(The letter ell.) Displays all available information about the selected services and service instances, with one service attribute displayed for each line. Information for different instances are separated by blank lines.

The following specific attributes require further explanation:

dependency

Information about a dependency. The grouping and restart_on properties are displayed first and are separated by a forward slash (/). Next, each entity and its state is listed. See smf(5) for information about states. In addition to the standard states, each service dependency can have the following state descriptions:

See smf(5) for additional details about dependencies, grouping, and restart_on values.

enabled

Whether the service is enabled or not, and whether it is enabled or disabled temporarily (until the next system reboot). The former is specified as either true or false, and the latter is designated by the presence of (temporary).

A service might be temporarily disabled because an administrator has run svcadm disable -t, used svcadm milestone, or booted the system to a specific milestone. See svcadm(1M) for details.

-ocol[,col]...

Prints the specified columns. Each col should be a column name. See COLUMNS below for available columns.

-p

Lists processes associated with each service instance. A service instance can have no associated processes. The process ID, start time, and command name (PID, STIME, and CMD fields from ps(1)) are displayed for each process.

-RFMRI-instance

Selects service instances that have the given service instance as their restarter.

-scol

Sorts output by column. col should be a column name. See COLUMNS below for available columns. Multiple -s options behave additively.

Without arguments, the -x option explains the states of services which:

are enabled, but are not running.

are preventing another enabled service from running.

Operands

The following operands are supported:

FMRI

A fault management resource identifier (FMRI) that specifies one or more instances (see smf(5)). FMRIs can be abbreviated by specifying the instance
name, or the trailing portion of the service name. For example, given the FMRI:

svc:/network/smtp:sendmail

The following are valid abbreviations:

sendmail
:sendmail
smtp
smtp:sendmail
network/smtp

The following are invalid abbreviations:

mail
network
network/smt

If the FMRI specifies a service, then the command applies to all instances of that service, except when used with the -D option.

Abbreviated forms of FMRIs are unstable, and should not be used in scripts or other permanent tools.

pattern

A pattern that is matched against the FMRIs of service instances according to the “globbing” rules described by fnmatch(5). If the pattern does not begin with svc:, then svc:/ is prepended. The following is a typical example of a glob pattern:

If the service instance entered the current state within the last 24 hours, this column indicates the time that it did so. Otherwise, this column indicates the date on which it did so, printed with underscores (_) in place of blanks.

Example 5 Listing Processes

Example 6 Explaining Service States Using svcs-x

(a) In this example, svcs-x has identified that the print/server service being disabled is the root cause of two services which are enabled but not online. svcs-xv shows that those services are print/rfc1179 and print/ipp-listener. This situation can be rectified by either enabling print/server or disabling rfc1179 and ipp-listener.