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 "17 Apr 2011" "SunOS 5.11" "User Commands"
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-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:
76 Displays an extended usage message, including column specifiers.
87 Show all services, even disabled ones. This option has no effect if services
99 Lists the services or service instances upon which the given service instances
111 Lists the service instances that depend on the given services or service
123 Omits the column headers.
134 (The letter ell.) Displays all available information about the selected
135 services and service instances, with one service attribute displayed for each
136 line. Information for different instances are separated by blank lines.
138 The following specific attributes require further explanation:
143 \fB\fBdependency\fR\fR
147 Information about a dependency. The grouping and \fBrestart_on\fR properties
148 are displayed first and are separated by a forward slash (\fB/\fR). Next, each
149 entity and its state is listed. See \fBsmf\fR(5) for information about states.
150 In addition to the standard states, each service dependency can have the
151 following state descriptions:
160 No such service is defined on the system.
171 The fault management resource identifier (FMRI) is invalid (see \fBsmf\fR(5)).
182 The entity is a service with multiple instances.
185 File dependencies can only have one of the following state descriptions:
194 No such file on the system.
207 If the file did not exist the last time that \fBsvc.startd\fR evaluated the
208 service's dependencies, it can consider the dependency to be unsatisfied.
209 \fBsvcadm refresh\fR forces dependency re-evaluation.
220 \fBstat\fR(2) failed for a reason other than \fBENOENT\fR.
223 See \fBsmf\fR(5) for additional details about dependencies, grouping, and
224 \fBrestart_on\fR values.
235 Whether the service is enabled or not, and whether it is enabled or disabled
236 temporarily (until the next system reboot). The former is specified as either
237 \fBtrue\fR or \fBfalse\fR, and the latter is designated by the presence of
240 A service might be temporarily disabled because an administrator has run
241 \fBsvcadm disable -t\fR, used \fBsvcadm milestone\fR, or booted the system to a
242 specific milestone. See \fBsvcadm\fR(1M) for details.
251 \fB\fB-o\fR \fIcol\fR[,\fIcol\fR]...\fR
255 Prints the specified columns. Each \fIcol\fR should be a column name. See
256 \fBCOLUMNS\fR below for available columns.
267 Lists processes associated with each service instance. A service instance can
268 have no associated processes. The process ID, start time, and command name
269 (\fBPID\fR, \fBSTIME\fR, and \fBCMD\fR fields from \fBps\fR(1)) are displayed
277 \fB\fB-R\fR \fIFMRI-instance\fR\fR
281 Selects service instances that have the given service instance as their
289 \fB\fB-s\fR \fIcol\fR\fR
293 Sorts output by column. \fIcol\fR should be a column name. See \fBCOLUMNS\fR
294 below for available columns. Multiple \fB-s\fR options behave additively.
301 \fB\fB-S\fR \fIcol\fR\fR
305 Sorts by \fIcol\fR in the opposite order as option \fB-s\fR.
316 Without \fB-x\fR or \fB-l\fR, displays verbose columns: \fBSTATE\fR,
317 \fBNSTATE\fR, \fBSTIME\fR, \fBCTID\fR, and \fBFMRI\fR.
319 With \fB-x\fR, displays extra information for each explanation.
321 With \fB-l\fR, displays user-visible properties in property groups of type
322 \fBapplication\fR and their description.
333 Displays explanations for service states.
335 Without arguments, the \fB-x\fR option explains the states of services which:
340 are enabled, but are not running.
346 are preventing another enabled service from running.
358 Display only the services in the \fIzone\fR. This option is only applicable
359 in the global zone, see \fBzones\fR(5).
370 Display services from all zones, with an additional column indicating in which
371 zone the service is running. This option is only applicable in the global
372 zone, see \fBzones\fR(5).
378 The following operands are supported:
387 A fault management resource identifier (FMRI) that specifies one or more
388 instances (see \fBsmf\fR(5)). FMRIs can be abbreviated by specifying the
389 instance name, or the trailing portion of the service name. For example, given
394 svc:/network/smtp:sendmail
399 The following are valid abbreviations:
412 The following are invalid abbreviations:
423 If the FMRI specifies a service, then the command applies to all instances of
424 that service, except when used with the \fB-D\fR option.
426 Abbreviated forms of FMRIs are unstable, and should not be used in scripts or
427 other permanent tools.
438 A pattern that is matched against the \fIFMRI\fRs of service instances
439 according to the "globbing" rules described by \fBfnmatch\fR(5). If the pattern
440 does not begin with \fBsvc:\fR, then \fBsvc:/\fR is prepended. The following is
441 a typical example of a glob pattern:
445 qexample% svcs \e*keyserv\e*
447 disabled Aug_02 svc:/network/rpc/keyserv:default
458 \fB\fIFMRI-instance\fR\fR
462 An FMRI that specifies an instance.
468 Column names are case insensitive. The default output format is equivalent to
469 "\fB-o\fR \fBstate,stime,fmri\fR". The default sorting columns are \fBSTATE\fR,
470 \fBSTIME\fR, \fBFMRI\fR.
479 The primary contract ID for the service instance. Not all instances have valid
480 primary contract IDs.
491 A brief description of the service, from its template element. A service might
492 not have a description available, in which case a hyphen (\fB\(hy\fR) is used
493 to denote an empty value.
504 The \fIFMRI\fR of the service instance.
515 The instance name of the service instance.
526 The abbreviated next state of the service instance, as given in the \fBSTA\fR
527 column description. A hyphen denotes that the instance is not transitioning.
528 Same as \fBSTA\fR otherwise.
539 The next state of the service. A hyphen is used to denote that the instance is
540 not transitioning. Same as \fBSTATE\fR otherwise.
551 The scope name of the service instance.
562 The service name of the service instance.
573 The abbreviated state of the service instance (see \fBsmf\fR(5)):
604 legacy \fBrc*.d\fR script-initiated instance
651 Absent or unrecognized states are denoted by a question mark (\fB?\fR)
652 character. An asterisk (\fB*\fR) is appended for instances in transition,
653 unless the \fBNSTA\fR or \fBNSTATE\fR column is also being displayed.
655 See \fBsmf\fR(5) for an explanation of service states.
666 The state of the service instance. An asterisk is appended for instances in
667 transition, unless the \fBNSTA\fR or \fBNSTATE\fR column is also being
670 See \fBsmf\fR(5) for an explanation of service states.
681 If the service instance entered the current state within the last 24 hours,
682 this column indicates the time that it did so. Otherwise, this column indicates
683 the date on which it did so, printed with underscores (\fB_\fR) in place of
689 \fBExample 1 \fRDisplaying the Default Output
692 This example displays default output:
700 legacy_run 13:25:04 lrc:/etc/rc3_d/S42myscript
702 online 13:21:50 svc:/system/svc/restarter:default
704 online 13:25:03 svc:/milestone/multi-user:default
706 online 13:25:07 svc:/milestone/multi-user-server:default
713 \fBExample 2 \fRListing All Local Instances
716 This example lists all local instances of the \fBservice1\fR service.
721 example% svcs -o state,nstate,fmri service1
723 online - svc:/service1:instance1
724 disabled - svc:/service1:instance2
730 \fBExample 3 \fRListing Verbose Information
733 This example lists verbose information.
738 example% svcs -v network/rpc/rstat:udp
739 STATE NSTATE STIME CTID FMRI
740 online - Aug_09 - svc:/network/rpc/rstat:udp
746 \fBExample 4 \fRListing Detailed Information
749 This example lists detailed information about all instances of
750 \fBsystem/service3\fR. Additional fields can be displayed, as appropriate to
751 the managing restarter.
756 example% svcs -l network/rpc/rstat:udp
758 fmri svc:/network/rpc/rstat:udp
762 restarter svc:/network/inetd:default
764 dependency require_all/error svc:/network/rpc/bind (online)
770 \fBExample 5 \fRListing Processes
774 example% svcs -p sendmail
776 online 13:25:13 svc:/network/smtp:sendmail
777 13:25:15 100939 sendmail
778 13:25:15 100940 sendmail
784 \fBExample 6 \fRExplaining Service States Using \fBsvcs\fR \fB-x\fR
787 (a) In this example, \fBsvcs\fR \fB-x\fR has identified that the print/server
788 service being disabled is the root cause of two services which are enabled but
789 not online. \fBsvcs\fR \fB-xv\fR shows that those services are
790 \fBprint/rfc1179\fR and \fBprint/ipp-listener\fR. This situation can be
791 rectified by either enabling \fBprint/server\fR or disabling \fBrfc1179\fR and
798 svc:/application/print/server:default (LP print server)
799 State: disabled since Mon Feb 13 17:56:21 2006
800 Reason: Disabled by an administrator.
801 See: http://sun.com/msg/SMF-8000-05
803 Impact: 2 dependent services are not running. (Use -v for list.)
810 (b) In this example, NFS is not working:
815 example$ svcs nfs/client
817 offline 16:03:23 svc:/network/nfs/client:default
824 (c) The following example shows that the problem is \fBnfs/status\fR.
825 \fBnfs/client\fR is waiting because it depends on \fBnfs/nlockmgr\fR, which
826 depends on \fBnfs/status\fR:
831 example$ svcs -xv nfs/client
832 svc:/network/nfs/client:default (NFS client)
833 State: offline since Mon Feb 27 16:03:23 2006
834 Reason: Service svc:/network/nfs/status:default
835 is not running because a method failed repeatedly.
836 See: http://sun.com/msg/SMF-8000-GE
837 Path: svc:/network/nfs/client:default
838 svc:/network/nfs/nlockmgr:default
839 svc:/network/nfs/status:default
840 See: man -M /usr/share/man -s 1M mount_nfs
841 See: /var/svc/log/network-nfs-client:default.log
842 Impact: This service is not running.
850 The following exit values are returned:
859 Successful command invocation.
881 Invalid command line options were specified.
887 See \fBattributes\fR(5) for descriptions of the following attributes:
896 ATTRIBUTE TYPE
\aATTRIBUTE VALUE
898 Interface Stability
\aSee below.
903 Screen output is Uncommitted. The invocation is Committed.
907 \fBps\fR(1), \fBsvcprop\fR(1), \fBsvcadm\fR(1M), \fBsvccfg\fR(1M),
908 \fBsvc.startd\fR(1M), \fBstat\fR(2), \fBlibscf\fR(3LIB), \fBattributes\fR(5),
909 \fBfnmatch\fR(5), \fBsmf\fR(5), \fBzones\fR(5)