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 "Apr 17, 2011"
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\fR | \fB-L\fR] [\fB-vZ\fR] [\fB-z\fR \fIzone\fR] [\fIFMRI\fR | \fIpattern\fR]...
29 \fBsvcs\fR \fB-x\fR [\fB-v\fR] [\fB-Z\fR | \fB-z\fR \fIzone\fR] [\fIFMRI\fR]...
35 The \fBsvcs\fR command displays information about service instances as recorded
36 in the service configuration repository.
39 The first form of this command prints one-line status listings for service
40 instances specified by the arguments. Each instance is listed only once. With
41 no arguments, all enabled service instances, even if temporarily disabled, are
42 listed with the columns indicated below.
45 The second form prints one-line status listings for the dependencies or
46 dependents of the service instances specified by the arguments.
49 The third form prints detailed information about specific services and
53 The fourth form explains the states of service instances. For each argument, a
54 block of human-readable text is displayed which explains what state the service
55 is in, and why it is in that state. With no arguments, problematic services are
59 Error messages are printed to the standard error stream.
62 The output of this command can be used appropriately as input to the
63 \fBsvcadm\fR(1M) command.
67 The following options are supported:
74 Displays an extended usage message, including column specifiers.
83 Show all services, even disabled ones. This option has no effect if services
93 Lists the services or service instances upon which the given service instances
103 Lists the service instances that depend on the given services or service
113 Omits the column headers.
122 (The letter ell.) Displays all available information about the selected
123 services and service instances, with one service attribute displayed for each
124 line. Information for different instances are separated by blank lines.
126 The following specific attributes require further explanation:
130 \fB\fBdependency\fR\fR
133 Information about a dependency. The grouping and \fBrestart_on\fR properties
134 are displayed first and are separated by a forward slash (\fB/\fR). Next, each
135 entity and its state is listed. See \fBsmf\fR(5) for information about states.
136 In addition to the standard states, each service dependency can have the
137 following state descriptions:
144 No such service is defined on the system.
153 The fault management resource identifier (FMRI) is invalid (see \fBsmf\fR(5)).
162 The entity is a service with multiple instances.
165 File dependencies can only have one of the following state descriptions:
172 No such file on the system.
183 If the file did not exist the last time that \fBsvc.startd\fR evaluated the
184 service's dependencies, it can consider the dependency to be unsatisfied.
185 \fBsvcadm refresh\fR forces dependency re-evaluation.
194 \fBstat\fR(2) failed for a reason other than \fBENOENT\fR.
197 See \fBsmf\fR(5) for additional details about dependencies, grouping, and
198 \fBrestart_on\fR values.
207 Whether the service is enabled or not, and whether it is enabled or disabled
208 temporarily (until the next system reboot). The former is specified as either
209 \fBtrue\fR or \fBfalse\fR, and the latter is designated by the presence of
212 A service might be temporarily disabled because an administrator has run
213 \fBsvcadm disable -t\fR, used \fBsvcadm milestone\fR, or booted the system to a
214 specific milestone. See \fBsvcadm\fR(1M) for details.
225 Display the log file of the selected services and service instances, one
232 \fB\fB-o\fR \fIcol\fR[,\fIcol\fR]...\fR
235 Prints the specified columns. Each \fIcol\fR should be a column name. See
236 \fBCOLUMNS\fR below for available columns.
245 Lists processes associated with each service instance. A service instance can
246 have no associated processes. The process ID, start time, and command name
247 (\fBPID\fR, \fBSTIME\fR, and \fBCMD\fR fields from \fBps\fR(1)) are displayed
254 \fB\fB-R\fR \fIFMRI-instance\fR\fR
257 Selects service instances that have the given service instance as their
264 \fB\fB-s\fR \fIcol\fR\fR
267 Sorts output by column. \fIcol\fR should be a column name. See \fBCOLUMNS\fR
268 below for available columns. Multiple \fB-s\fR options behave additively.
274 \fB\fB-S\fR \fIcol\fR\fR
277 Sorts by \fIcol\fR in the opposite order as option \fB-s\fR.
286 Without \fB-x\fR or \fB-l\fR, displays verbose columns: \fBSTATE\fR,
287 \fBNSTATE\fR, \fBSTIME\fR, \fBCTID\fR, and \fBFMRI\fR.
289 With \fB-x\fR, displays extra information for each explanation.
291 With \fB-l\fR, displays user-visible properties in property groups of type
292 \fBapplication\fR and their description.
301 Displays explanations for service states.
303 Without arguments, the \fB-x\fR option explains the states of services which:
308 are enabled, but are not running.
314 are preventing another enabled service from running.
324 Display only the services in the \fIzone\fR. This option is only applicable
325 in the global zone, see \fBzones\fR(5).
334 Display services from all zones, with an additional column indicating in which
335 zone the service is running. This option is only applicable in the global
336 zone, see \fBzones\fR(5).
342 The following operands are supported:
349 A fault management resource identifier (FMRI) that specifies one or more
350 instances (see \fBsmf\fR(5)). FMRIs can be abbreviated by specifying the
351 instance name, or the trailing portion of the service name. For example, given
356 svc:/network/smtp:sendmail
361 The following are valid abbreviations:
374 The following are invalid abbreviations:
385 If the FMRI specifies a service, then the command applies to all instances of
386 that service, except when used with the \fB-D\fR option.
388 Abbreviated forms of FMRIs are unstable, and should not be used in scripts or
389 other permanent tools.
398 A pattern that is matched against the \fIFMRI\fRs of service instances
399 according to the "globbing" rules described by \fBfnmatch\fR(5). If the pattern
400 does not begin with \fBsvc:\fR, then \fBsvc:/\fR is prepended. The following is
401 a typical example of a glob pattern:
405 qexample% svcs \e*keyserv\e*
407 disabled Aug_02 svc:/network/rpc/keyserv:default
417 \fB\fIFMRI-instance\fR\fR
420 An FMRI that specifies an instance.
426 Column names are case insensitive. The default output format is equivalent to
427 "\fB-o\fR \fBstate,stime,fmri\fR". The default sorting columns are \fBSTATE\fR,
428 \fBSTIME\fR, \fBFMRI\fR.
435 The primary contract ID for the service instance. Not all instances have valid
436 primary contract IDs.
445 A brief description of the service, from its template element. A service might
446 not have a description available, in which case a hyphen (\fB\(hy\fR) is used
447 to denote an empty value.
456 The \fIFMRI\fR of the service instance.
465 The instance name of the service instance.
474 The abbreviated next state of the service instance, as given in the \fBSTA\fR
475 column description. A hyphen denotes that the instance is not transitioning.
476 Same as \fBSTA\fR otherwise.
485 The next state of the service. A hyphen is used to denote that the instance is
486 not transitioning. Same as \fBSTATE\fR otherwise.
495 The scope name of the service instance.
504 The service name of the service instance.
513 The abbreviated state of the service instance (see \fBsmf\fR(5)):
538 legacy \fBrc*.d\fR script-initiated instance
577 Absent or unrecognized states are denoted by a question mark (\fB?\fR)
578 character. An asterisk (\fB*\fR) is appended for instances in transition,
579 unless the \fBNSTA\fR or \fBNSTATE\fR column is also being displayed.
581 See \fBsmf\fR(5) for an explanation of service states.
590 The state of the service instance. An asterisk is appended for instances in
591 transition, unless the \fBNSTA\fR or \fBNSTATE\fR column is also being
594 See \fBsmf\fR(5) for an explanation of service states.
603 If the service instance entered the current state within the last 24 hours,
604 this column indicates the time that it did so. Otherwise, this column indicates
605 the date on which it did so, printed with underscores (\fB_\fR) in place of
611 \fBExample 1 \fRDisplaying the Default Output
614 This example displays default output:
622 legacy_run 13:25:04 lrc:/etc/rc3_d/S42myscript
624 online 13:21:50 svc:/system/svc/restarter:default
626 online 13:25:03 svc:/milestone/multi-user:default
628 online 13:25:07 svc:/milestone/multi-user-server:default
635 \fBExample 2 \fRListing All Local Instances
638 This example lists all local instances of the \fBservice1\fR service.
643 example% svcs -o state,nstate,fmri service1
645 online - svc:/service1:instance1
646 disabled - svc:/service1:instance2
652 \fBExample 3 \fRListing Verbose Information
655 This example lists verbose information.
660 example% svcs -v network/rpc/rstat:udp
661 STATE NSTATE STIME CTID FMRI
662 online - Aug_09 - svc:/network/rpc/rstat:udp
668 \fBExample 4 \fRListing Detailed Information
671 This example lists detailed information about all instances of
672 \fBsystem/service3\fR. Additional fields can be displayed, as appropriate to
673 the managing restarter.
678 example% svcs -l network/rpc/rstat:udp
680 fmri svc:/network/rpc/rstat:udp
684 restarter svc:/network/inetd:default
686 dependency require_all/error svc:/network/rpc/bind (online)
692 \fBExample 5 \fRListing Processes
696 example% svcs -p sendmail
698 online 13:25:13 svc:/network/smtp:sendmail
699 13:25:15 100939 sendmail
700 13:25:15 100940 sendmail
706 \fBExample 6 \fRExplaining Service States Using \fBsvcs\fR \fB-x\fR
709 (a) In this example, \fBsvcs\fR \fB-x\fR has identified that the print/server
710 service being disabled is the root cause of two services which are enabled but
711 not online. \fBsvcs\fR \fB-xv\fR shows that those services are
712 \fBprint/rfc1179\fR and \fBprint/ipp-listener\fR. This situation can be
713 rectified by either enabling \fBprint/server\fR or disabling \fBrfc1179\fR and
720 svc:/application/print/server:default (LP print server)
721 State: disabled since Mon Feb 13 17:56:21 2006
722 Reason: Disabled by an administrator.
723 See: http://illumos.org/msg/SMF-8000-05
725 Impact: 2 dependent services are not running. (Use -v for list.)
732 (b) In this example, NFS is not working:
737 example$ svcs nfs/client
739 offline 16:03:23 svc:/network/nfs/client:default
746 (c) The following example shows that the problem is \fBnfs/status\fR.
747 \fBnfs/client\fR is waiting because it depends on \fBnfs/nlockmgr\fR, which
748 depends on \fBnfs/status\fR:
753 example$ svcs -xv nfs/client
754 svc:/network/nfs/client:default (NFS client)
755 State: offline since Mon Feb 27 16:03:23 2006
756 Reason: Service svc:/network/nfs/status:default
757 is not running because a method failed repeatedly.
758 See: http://illumos.org/msg/SMF-8000-GE
759 Path: svc:/network/nfs/client:default
760 svc:/network/nfs/nlockmgr:default
761 svc:/network/nfs/status:default
762 See: man -M /usr/share/man -s 1M mount_nfs
763 See: /var/svc/log/network-nfs-client:default.log
764 Impact: This service is not running.
772 The following exit values are returned:
779 Successful command invocation.
797 Invalid command line options were specified.
803 See \fBattributes\fR(5) for descriptions of the following attributes:
811 ATTRIBUTE TYPE ATTRIBUTE VALUE
813 Interface Stability See below.
818 Screen output is Uncommitted. The invocation is Committed.
822 \fBps\fR(1), \fBsvcprop\fR(1), \fBsvcadm\fR(1M), \fBsvccfg\fR(1M),
823 \fBsvc.startd\fR(1M), \fBstat\fR(2), \fBlibscf\fR(3LIB), \fBattributes\fR(5),
824 \fBfnmatch\fR(5), \fBsmf\fR(5), \fBzones\fR(5)