SVCS(1) | User Commands | SVCS(1) |
svcs - report service status
svcs [-aHpv?] [-Z | -z zone] [-o col[,col]]... [-R FMRI-instance]...
[-sS col]... [FMRI | pattern]...
svcs {-d | -D} [-Hpv?] [-Z | -z zone] [-o col[,col]]... [-sS col]...
[FMRI | pattern] ...
svcs [-l | -L] [-vZ] [-z zone] [FMRI | pattern]...
svcs -x [-v] [-Z | -z zone] [FMRI]...
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(8) command.
The following options are supported:
-?
-a
-d
-D
-H
-l
The following specific attributes require further explanation:
dependency
absent
invalid
multiple
File dependencies can only have one of the following state descriptions:
absent
online
If the file did not exist the last time that svc.startd evaluated the service's dependencies, it can consider the dependency to be unsatisfied. svcadm refresh forces dependency re-evaluation.
unknown
See smf(7) for additional details about dependencies, grouping, and restart_on values.
enabled
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(8) for details.
If a service instance was disabled via svcadm disable -c , then the provided comment will also be displayed.
-L
-o col[,col]...
-p
-R FMRI-instance
-s col
-S col
-v
With -x, displays extra information for each explanation.
With -l, displays user-visible properties in property groups of type application and their description.
-x
Without arguments, the -x option explains the states of services which:
-z zone
-Z
The following operands are supported:
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
qexample% svcs \*keyserv\* STATE STIME FMRI disabled Aug_02 svc:/network/rpc/keyserv:default
FMRI-instance
Column names are case insensitive. The default output format is equivalent to "-o state,stime,fmri". The default sorting columns are STATE, STIME, FMRI.
CTID
DESC
FMRI
INST
NSTA
NSTATE
SCOPE
SVC
STA
DGD
DIS
LRC
MNT
OFF
ON
UN
Absent or unrecognized states are denoted by a question mark (?) character. An asterisk (*) is appended for instances in transition, unless the NSTA or NSTATE column is also being displayed.
See smf(7) for an explanation of service states.
STATE
See smf(7) for an explanation of service states.
STIME
Example 1 Displaying the Default Output
This example displays default output:
example% svcs STATE STIME FMRI ... legacy_run 13:25:04 lrc:/etc/rc3_d/S42myscript ... online 13:21:50 svc:/system/svc/restarter:default ... online 13:25:03 svc:/milestone/multi-user:default ... online 13:25:07 svc:/milestone/multi-user-server:default ...
Example 2 Listing All Local Instances
This example lists all local instances of the service1 service.
example% svcs -o state,nstate,fmri service1 STATE NSTATE FMRI online - svc:/service1:instance1 disabled - svc:/service1:instance2
Example 3 Listing Verbose Information
This example lists verbose information.
example% svcs -v network/rpc/rstat:udp STATE NSTATE STIME CTID FMRI online - Aug_09 - svc:/network/rpc/rstat:udp
Example 4 Listing Detailed Information
This example lists detailed information about all instances of system/service3. Additional fields can be displayed, as appropriate to the managing restarter.
example% svcs -l network/rpc/rstat:udp fmri svc:/network/rpc/rstat:udp enabled true state online next_state none restarter svc:/network/inetd:default contract_id dependency require_all/error svc:/network/rpc/bind (online)
Example 5 Listing Processes
example% svcs -p sendmail STATE STIME FMRI online 13:25:13 svc:/network/smtp:sendmail
13:25:15 100939 sendmail 13:25:15 100940 sendmail
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.
example% svcs -x svc:/application/print/server:default (LP print server)
State: disabled since Mon Feb 13 17:56:21 2006 Reason: Disabled by an administrator.
See: http://illumos.org/msg/SMF-8000-05
See: lpsched(8) Impact: 2 dependent services are not running. (Use -v for list.)
(b) In this example, NFS is not working:
example$ svcs nfs/client STATE STIME FMRI offline 16:03:23 svc:/network/nfs/client:default
(c) The following example shows that the problem is nfs/status. nfs/client is waiting because it depends on nfs/nlockmgr, which depends on nfs/status:
example$ svcs -xv nfs/client svc:/network/nfs/client:default (NFS client)
State: offline since Mon Feb 27 16:03:23 2006 Reason: Service svc:/network/nfs/status:default
is not running because a method failed repeatedly.
See: http://illumos.org/msg/SMF-8000-GE
Path: svc:/network/nfs/client:default
svc:/network/nfs/nlockmgr:default
svc:/network/nfs/status:default
See: man -M /usr/share/man -s 8 mount_nfs
See: /var/svc/log/network-nfs-client:default.log Impact: This service is not running.
The following exit values are returned:
0
1
2
See attributes(7) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
Interface Stability | See below. |
Screen output is Uncommitted. The invocation is Committed.
ps(1), svcprop(1), stat(2), libscf(3LIB), attributes(7), fnmatch(7), smf(7), zones(7), svc.startd(8), svcadm(8), svccfg(8)
May 11, 2020 | OmniOS |