2 .\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH SVCS 1 "Feb 21, 2018"
8 svcs \- report service status
12 \fBsvcs\fR [\fB-aHpv?\fR] [\fB-Z\fR | \fB-z\fR \fIzone\fR] [\fB-o\fR \fIcol\fR[,\fIcol\fR]]... [\fB-R\fR \fIFMRI-instance\fR]...
13 [\fB-sS\fR \fIcol\fR]... [\fIFMRI\fR | \fIpattern\fR]...
18 \fBsvcs\fR {\fB-d\fR | \fB-D\fR} [\fB-Hpv?\fR] [\fB-Z\fR | \fB-z\fR \fIzone\fR] [\fB-o\fR \fIcol\fR[,\fIcol\fR]]... [\fB-sS\fR \fIcol\fR]...
19 [\fIFMRI\fR | \fIpattern\fR] ...
24 \fBsvcs\fR [\fB-l] [\fB-vZ\fR] [\fB-z\fR \fIzone\fR] [\fIFMRI\fR | \fIpattern\fR]...
29 \fBsvcs\fR [\fB-L\fR] [\fB-vZ\fR] [\fB-z\fR \fIzone\fR] [\fIFMRI\fR | \fIpattern\fR]...
34 \fBsvcs\fR \fB-x\fR [\fB-L\fR] [\fB-v\fR] [\fB-Z\fR | \fB-z\fR \fIzone\fR] [\fIFMRI\fR]...
40 The \fBsvcs\fR command displays information about service instances as recorded
41 in the service configuration repository.
44 The first form of this command prints one-line status listings for service
45 instances specified by the arguments. Each instance is listed only once. With
46 no arguments, all enabled service instances, even if temporarily disabled, are
47 listed with the columns indicated below.
50 The second form prints one-line status listings for the dependencies or
51 dependents of the service instances specified by the arguments.
54 The third form prints detailed information about specific services and
58 The fourth form explains the states of service instances. For each argument, a
59 block of human-readable text is displayed which explains what state the service
60 is in, and why it is in that state. With no arguments, problematic services are
64 Error messages are printed to the standard error stream.
67 The output of this command can be used appropriately as input to the
68 \fBsvcadm\fR(8) command.
72 The following options are supported:
79 Displays an extended usage message, including column specifiers.
88 Show all services, even disabled ones. This option has no effect if services
98 Lists the services or service instances upon which the given service instances
108 Lists the service instances that depend on the given services or service
118 Omits the column headers.
127 (The letter ell.) Displays all available information about the selected
128 services and service instances, with one service attribute displayed for each
129 line. Information for different instances are separated by blank lines.
131 The following specific attributes require further explanation:
135 \fB\fBdependency\fR\fR
138 Information about a dependency. The grouping and \fBrestart_on\fR properties
139 are displayed first and are separated by a forward slash (\fB/\fR). Next, each
140 entity and its state is listed. See \fBsmf\fR(5) for information about states.
141 In addition to the standard states, each service dependency can have the
142 following state descriptions:
149 No such service is defined on the system.
158 The fault management resource identifier (FMRI) is invalid (see \fBsmf\fR(5)).
167 The entity is a service with multiple instances.
170 File dependencies can only have one of the following state descriptions:
177 No such file on the system.
188 If the file did not exist the last time that \fBsvc.startd\fR evaluated the
189 service's dependencies, it can consider the dependency to be unsatisfied.
190 \fBsvcadm refresh\fR forces dependency re-evaluation.
199 \fBstat\fR(2) failed for a reason other than \fBENOENT\fR.
202 See \fBsmf\fR(5) for additional details about dependencies, grouping, and
203 \fBrestart_on\fR values.
212 Whether the service is enabled or not, and whether it is enabled or disabled
213 temporarily (until the next system reboot). The former is specified as either
214 \fBtrue\fR or \fBfalse\fR, and the latter is designated by the presence of
217 A service might be temporarily disabled because an administrator has run
218 \fBsvcadm disable -t\fR, used \fBsvcadm milestone\fR, or booted the system to a
219 specific milestone. See \fBsvcadm\fR(8) for details.
230 Display the log file of the selected services and service instances, one
231 per-line. With \fB-v\fR, displays full contents of the log file. With \fB-x\fR,
232 displays the last 5 entries of the log file.
238 \fB\fB-o\fR \fIcol\fR[,\fIcol\fR]...\fR
241 Prints the specified columns. Each \fIcol\fR should be a column name. See
242 \fBCOLUMNS\fR below for available columns.
251 Lists processes associated with each service instance. A service instance can
252 have no associated processes. The process ID, start time, and command name
253 (\fBPID\fR, \fBSTIME\fR, and \fBCMD\fR fields from \fBps\fR(1)) are displayed
260 \fB\fB-R\fR \fIFMRI-instance\fR\fR
263 Selects service instances that have the given service instance as their
270 \fB\fB-s\fR \fIcol\fR\fR
273 Sorts output by column. \fIcol\fR should be a column name. See \fBCOLUMNS\fR
274 below for available columns. Multiple \fB-s\fR options behave additively.
280 \fB\fB-S\fR \fIcol\fR\fR
283 Sorts by \fIcol\fR in the opposite order as option \fB-s\fR.
292 Without \fB-x\fR or \fB-l\fR, displays verbose columns: \fBSTATE\fR,
293 \fBNSTATE\fR, \fBSTIME\fR, \fBCTID\fR, and \fBFMRI\fR.
295 With \fB-x\fR, displays extra information for each explanation.
297 With \fB-l\fR, displays user-visible properties in property groups of type
298 \fBapplication\fR and their description.
307 Displays explanations for service states.
309 Without arguments, the \fB-x\fR option explains the states of services which:
314 are enabled, but are not running.
320 are preventing another enabled service from running.
330 Display only the services in the \fIzone\fR. This option is only applicable
331 in the global zone, see \fBzones\fR(5).
340 Display services from all zones, with an additional column indicating in which
341 zone the service is running. This option is only applicable in the global
342 zone, see \fBzones\fR(5).
348 The following operands are supported:
355 A fault management resource identifier (FMRI) that specifies one or more
356 instances (see \fBsmf\fR(5)). FMRIs can be abbreviated by specifying the
357 instance name, or the trailing portion of the service name. For example, given
362 svc:/network/smtp:sendmail
367 The following are valid abbreviations:
380 The following are invalid abbreviations:
391 If the FMRI specifies a service, then the command applies to all instances of
392 that service, except when used with the \fB-D\fR option.
394 Abbreviated forms of FMRIs are unstable, and should not be used in scripts or
395 other permanent tools.
404 A pattern that is matched against the \fIFMRI\fRs of service instances
405 according to the "globbing" rules described by \fBfnmatch\fR(5). If the pattern
406 does not begin with \fBsvc:\fR, then \fBsvc:/\fR is prepended. The following is
407 a typical example of a glob pattern:
411 qexample% svcs \e*keyserv\e*
413 disabled Aug_02 svc:/network/rpc/keyserv:default
423 \fB\fIFMRI-instance\fR\fR
426 An FMRI that specifies an instance.
432 Column names are case insensitive. The default output format is equivalent to
433 "\fB-o\fR \fBstate,stime,fmri\fR". The default sorting columns are \fBSTATE\fR,
434 \fBSTIME\fR, \fBFMRI\fR.
441 The primary contract ID for the service instance. Not all instances have valid
442 primary contract IDs.
451 A brief description of the service, from its template element. A service might
452 not have a description available, in which case a hyphen (\fB\(hy\fR) is used
453 to denote an empty value.
462 The \fIFMRI\fR of the service instance.
471 The instance name of the service instance.
480 The abbreviated next state of the service instance, as given in the \fBSTA\fR
481 column description. A hyphen denotes that the instance is not transitioning.
482 Same as \fBSTA\fR otherwise.
491 The next state of the service. A hyphen is used to denote that the instance is
492 not transitioning. Same as \fBSTATE\fR otherwise.
501 The scope name of the service instance.
510 The service name of the service instance.
519 The abbreviated state of the service instance (see \fBsmf\fR(5)):
544 legacy \fBrc*.d\fR script-initiated instance
583 Absent or unrecognized states are denoted by a question mark (\fB?\fR)
584 character. An asterisk (\fB*\fR) is appended for instances in transition,
585 unless the \fBNSTA\fR or \fBNSTATE\fR column is also being displayed.
587 See \fBsmf\fR(5) for an explanation of service states.
596 The state of the service instance. An asterisk is appended for instances in
597 transition, unless the \fBNSTA\fR or \fBNSTATE\fR column is also being
600 See \fBsmf\fR(5) for an explanation of service states.
609 If the service instance entered the current state within the last 24 hours,
610 this column indicates the time that it did so. Otherwise, this column indicates
611 the date on which it did so, printed with underscores (\fB_\fR) in place of
617 \fBExample 1 \fRDisplaying the Default Output
620 This example displays default output:
628 legacy_run 13:25:04 lrc:/etc/rc3_d/S42myscript
630 online 13:21:50 svc:/system/svc/restarter:default
632 online 13:25:03 svc:/milestone/multi-user:default
634 online 13:25:07 svc:/milestone/multi-user-server:default
641 \fBExample 2 \fRListing All Local Instances
644 This example lists all local instances of the \fBservice1\fR service.
649 example% svcs -o state,nstate,fmri service1
651 online - svc:/service1:instance1
652 disabled - svc:/service1:instance2
658 \fBExample 3 \fRListing Verbose Information
661 This example lists verbose information.
666 example% svcs -v network/rpc/rstat:udp
667 STATE NSTATE STIME CTID FMRI
668 online - Aug_09 - svc:/network/rpc/rstat:udp
674 \fBExample 4 \fRListing Detailed Information
677 This example lists detailed information about all instances of
678 \fBsystem/service3\fR. Additional fields can be displayed, as appropriate to
679 the managing restarter.
684 example% svcs -l network/rpc/rstat:udp
686 fmri svc:/network/rpc/rstat:udp
690 restarter svc:/network/inetd:default
692 dependency require_all/error svc:/network/rpc/bind (online)
698 \fBExample 5 \fRListing Processes
702 example% svcs -p sendmail
704 online 13:25:13 svc:/network/smtp:sendmail
705 13:25:15 100939 sendmail
706 13:25:15 100940 sendmail
712 \fBExample 6 \fRExplaining Service States Using \fBsvcs\fR \fB-x\fR
715 (a) In this example, \fBsvcs\fR \fB-x\fR has identified that the print/server
716 service being disabled is the root cause of two services which are enabled but
717 not online. \fBsvcs\fR \fB-xv\fR shows that those services are
718 \fBprint/rfc1179\fR and \fBprint/ipp-listener\fR. This situation can be
719 rectified by either enabling \fBprint/server\fR or disabling \fBrfc1179\fR and
726 svc:/application/print/server:default (LP print server)
727 State: disabled since Mon Feb 13 17:56:21 2006
728 Reason: Disabled by an administrator.
729 See: http://illumos.org/msg/SMF-8000-05
731 Impact: 2 dependent services are not running. (Use -v for list.)
738 (b) In this example, NFS is not working:
743 example$ svcs nfs/client
745 offline 16:03:23 svc:/network/nfs/client:default
752 (c) The following example shows that the problem is \fBnfs/status\fR.
753 \fBnfs/client\fR is waiting because it depends on \fBnfs/nlockmgr\fR, which
754 depends on \fBnfs/status\fR:
759 example$ svcs -xv nfs/client
760 svc:/network/nfs/client:default (NFS client)
761 State: offline since Mon Feb 27 16:03:23 2006
762 Reason: Service svc:/network/nfs/status:default
763 is not running because a method failed repeatedly.
764 See: http://illumos.org/msg/SMF-8000-GE
765 Path: svc:/network/nfs/client:default
766 svc:/network/nfs/nlockmgr:default
767 svc:/network/nfs/status:default
768 See: man -M /usr/share/man -s 8 mount_nfs
769 See: /var/svc/log/network-nfs-client:default.log
770 Impact: This service is not running.
778 The following exit values are returned:
785 Successful command invocation.
803 Invalid command line options were specified.
809 See \fBattributes\fR(5) for descriptions of the following attributes:
817 ATTRIBUTE TYPE ATTRIBUTE VALUE
819 Interface Stability See below.
824 Screen output is Uncommitted. The invocation is Committed.
828 \fBps\fR(1), \fBsvcprop\fR(1), \fBsvcadm\fR(8), \fBsvccfg\fR(8),
829 \fBsvc.startd\fR(8), \fBstat\fR(2), \fBlibscf\fR(3LIB), \fBattributes\fR(5),
830 \fBfnmatch\fR(5), \fBsmf\fR(5), \fBzones\fR(5)