Merge commit 'b31320a79e2054c6739b5229259dbf98f3afc547' into merges
[unleashed.git] / share / man / man1 / svcs.1
bloba777621b8472090cca21f801afb656814debed4a
1 '\" te
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"
7 .SH NAME
8 svcs \- report service status
9 .SH SYNOPSIS
10 .LP
11 .nf
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]...
14 .fi
16 .LP
17 .nf
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] ...
20 .fi
22 .LP
23 .nf
24 \fBsvcs\fR [\fB-l] [\fB-vZ\fR] [\fB-z\fR \fIzone\fR] [\fIFMRI\fR | \fIpattern\fR]...
25 .fi
27 .LP
28 .nf
29 \fBsvcs\fR [\fB-L\fR] [\fB-vZ\fR] [\fB-z\fR \fIzone\fR] [\fIFMRI\fR | \fIpattern\fR]...
30 .fi
32 .LP
33 .nf
34 \fBsvcs\fR \fB-x\fR [\fB-L\fR] [\fB-v\fR] [\fB-Z\fR | \fB-z\fR \fIzone\fR] [\fIFMRI\fR]...
35 .fi
37 .SH DESCRIPTION
38 .sp
39 .LP
40 The \fBsvcs\fR command displays information about service instances as recorded
41 in the service configuration repository.
42 .sp
43 .LP
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.
48 .sp
49 .LP
50 The second form prints one-line status listings for the dependencies or
51 dependents of the service instances specified by the arguments.
52 .sp
53 .LP
54 The third form prints detailed information about specific services and
55 instances.
56 .sp
57 .LP
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
61 described.
62 .sp
63 .LP
64 Error messages are printed to the standard error stream.
65 .sp
66 .LP
67 The output of this command can be used appropriately as input to the
68 \fBsvcadm\fR(8) command.
69 .SH OPTIONS
70 .sp
71 .LP
72 The following options are supported:
73 .sp
74 .ne 2
75 .na
76 \fB\fB-?\fR\fR
77 .ad
78 .RS 20n
79 Displays an extended usage message, including column specifiers.
80 .RE
82 .sp
83 .ne 2
84 .na
85 \fB\fB-a\fR\fR
86 .ad
87 .RS 20n
88 Show all services, even disabled ones. This option has no effect if services
89 are selected.
90 .RE
92 .sp
93 .ne 2
94 .na
95 \fB\fB-d\fR\fR
96 .ad
97 .RS 20n
98 Lists the services or service instances upon which the given service instances
99 depend.
103 .ne 2
105 \fB\fB-D\fR\fR
107 .RS 20n
108 Lists the service instances that depend on the given services or service
109 instances.
113 .ne 2
115 \fB\fB-H\fR\fR
117 .RS 20n
118 Omits the column headers.
122 .ne 2
124 \fB\fB-l\fR\fR
126 .RS 20n
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:
133 .ne 2
135 \fB\fBdependency\fR\fR
137 .RS 14n
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:
144 .ne 2
146 \fB\fBabsent\fR\fR
148 .RS 12n
149 No such service is defined on the system.
153 .ne 2
155 \fB\fBinvalid\fR\fR
157 .RS 12n
158 The fault management resource identifier (FMRI) is invalid (see \fBsmf\fR(5)).
162 .ne 2
164 \fB\fBmultiple\fR\fR
166 .RS 12n
167 The entity is a service with multiple instances.
170 File dependencies can only have one of the following state descriptions:
172 .ne 2
174 \fB\fBabsent\fR\fR
176 .RS 11n
177 No such file on the system.
181 .ne 2
183 \fB\fBonline\fR\fR
185 .RS 11n
186 The file exists.
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.
194 .ne 2
196 \fB\fBunknown\fR\fR
198 .RS 11n
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.
207 .ne 2
209 \fB\fBenabled\fR\fR
211 .RS 14n
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
215 \fB(temporary)\fR.
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.
225 .ne 2
227 \fB-L\fR
229 .RS 20n
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.
236 .ne 2
238 \fB\fB-o\fR \fIcol\fR[,\fIcol\fR]...\fR
240 .RS 20n
241 Prints the specified columns. Each \fIcol\fR should be a column name. See
242 \fBCOLUMNS\fR below for available columns.
246 .ne 2
248 \fB\fB-p\fR\fR
250 .RS 20n
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
254 for each process.
258 .ne 2
260 \fB\fB-R\fR \fIFMRI-instance\fR\fR
262 .RS 20n
263 Selects service instances that have the given service instance as their
264 restarter.
268 .ne 2
270 \fB\fB-s\fR \fIcol\fR\fR
272 .RS 20n
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.
278 .ne 2
280 \fB\fB-S\fR \fIcol\fR\fR
282 .RS 20n
283 Sorts by \fIcol\fR in the opposite order as option \fB-s\fR.
287 .ne 2
289 \fB\fB-v\fR\fR
291 .RS 20n
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.
302 .ne 2
304 \fB\fB-x\fR\fR
306 .RS 20n
307 Displays explanations for service states.
309 Without arguments, the \fB-x\fR option explains the states of services which:
310 .RS +4
312 .ie t \(bu
313 .el o
314 are enabled, but are not running.
316 .RS +4
318 .ie t \(bu
319 .el o
320 are preventing another enabled service from running.
325 .ne 2
327 \fB-z \fIzone\fR
329 .RS 20n
330 Display only the services in the \fIzone\fR.  This option is only applicable
331 in the global zone, see \fBzones\fR(5).
335 .ne 2
337 \fB-Z\fR
339 .RS 20n
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).
345 .SH OPERANDS
348 The following operands are supported:
350 .ne 2
352 \fB\fIFMRI\fR\fR
354 .RS 17n
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
358 the FMRI:
360 .in +2
362 svc:/network/smtp:sendmail
364 .in -2
367 The following are valid abbreviations:
369 .in +2
371 sendmail
372 :sendmail
373 smtp
374 smtp:sendmail
375 network/smtp
377 .in -2
380 The following are invalid abbreviations:
382 .in +2
384 mail
385 network
386 network/smt
388 .in -2
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.
399 .ne 2
401 \fB\fIpattern\fR\fR
403 .RS 17n
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:
409 .in +2
411 qexample% svcs \e*keyserv\e*
412 STATE          STIME     FMRI
413 disabled       Aug_02    svc:/network/rpc/keyserv:default
415 .in -2
421 .ne 2
423 \fB\fIFMRI-instance\fR\fR
425 .RS 17n
426 An FMRI that specifies an instance.
429 .SH COLUMNS
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.
436 .ne 2
438 \fB\fBCTID\fR\fR
440 .RS 10n
441 The primary contract ID for the service instance. Not all instances have valid
442 primary contract IDs.
446 .ne 2
448 \fB\fBDESC\fR\fR
450 .RS 10n
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.
457 .ne 2
459 \fB\fBFMRI\fR\fR
461 .RS 10n
462 The \fIFMRI\fR of the service instance.
466 .ne 2
468 \fB\fBINST\fR\fR
470 .RS 10n
471 The instance name of the service instance.
475 .ne 2
477 \fB\fBNSTA\fR\fR
479 .RS 10n
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.
486 .ne 2
488 \fB\fBNSTATE\fR\fR
490 .RS 10n
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.
496 .ne 2
498 \fB\fBSCOPE\fR\fR
500 .RS 10n
501 The scope name of the service instance.
505 .ne 2
507 \fB\fBSVC\fR\fR
509 .RS 10n
510 The service name of the service instance.
514 .ne 2
516 \fB\fBSTA\fR\fR
518 .RS 10n
519 The abbreviated state of the service instance (see \fBsmf\fR(5)):
521 .ne 2
523 \fB\fBDGD\fR\fR
525 .RS 7n
526 degraded
530 .ne 2
532 \fB\fBDIS\fR\fR
534 .RS 7n
535 disabled
539 .ne 2
541 \fB\fBLRC\fR\fR
543 .RS 7n
544 legacy \fBrc*.d\fR script-initiated instance
548 .ne 2
550 \fB\fBMNT\fR\fR
552 .RS 7n
553 maintenance
557 .ne 2
559 \fB\fBOFF\fR\fR
561 .RS 7n
562 offline
566 .ne 2
568 \fB\fBON\fR\fR
570 .RS 7n
571 online
575 .ne 2
577 \fB\fBUN\fR\fR
579 .RS 7n
580 uninitialized
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.
591 .ne 2
593 \fB\fBSTATE\fR\fR
595 .RS 10n
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
598 displayed.
600 See \fBsmf\fR(5) for an explanation of service states.
604 .ne 2
606 \fB\fBSTIME\fR\fR
608 .RS 10n
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
612 blanks.
615 .SH EXAMPLES
617 \fBExample 1 \fRDisplaying the Default Output
620 This example displays default output:
623 .in +2
625 example% svcs
626 STATE          STIME    FMRI
627 \&...
628 legacy_run     13:25:04 lrc:/etc/rc3_d/S42myscript
629 \&...
630 online         13:21:50 svc:/system/svc/restarter:default
631 \&...
632 online         13:25:03 svc:/milestone/multi-user:default
633 \&...
634 online         13:25:07 svc:/milestone/multi-user-server:default
635 \&...
637 .in -2
641 \fBExample 2 \fRListing All Local Instances
644 This example lists all local instances of the \fBservice1\fR service.
647 .in +2
649 example% svcs -o state,nstate,fmri service1
650 STATE        NSTATE        FMRI
651 online       -             svc:/service1:instance1
652 disabled     -             svc:/service1:instance2
654 .in -2
658 \fBExample 3 \fRListing Verbose Information
661 This example lists verbose information.
664 .in +2
666 example% svcs -v network/rpc/rstat:udp
667 STATE          NSTATE        STIME    CTID   FMRI
668 online         -             Aug_09        - svc:/network/rpc/rstat:udp
670 .in -2
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.
682 .in +2
684 example% svcs -l network/rpc/rstat:udp
686 fmri         svc:/network/rpc/rstat:udp
687 enabled      true
688 state        online
689 next_state   none
690 restarter    svc:/network/inetd:default
691 contract_id
692 dependency   require_all/error svc:/network/rpc/bind (online)
694 .in -2
698 \fBExample 5 \fRListing Processes
700 .in +2
702 example% svcs -p sendmail
703 STATE          STIME    FMRI
704 online         13:25:13 svc:/network/smtp:sendmail
705                13:25:15   100939 sendmail
706 13:25:15   100940 sendmail
708 .in -2
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
720 \fBipp-listener\fR.
723 .in +2
725 example% svcs -x
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
730    See: lpsched(8)
731 Impact: 2 dependent services are not running. (Use -v for list.)
733 .in -2
738 (b) In this example, NFS is not working:
741 .in +2
743 example$ svcs nfs/client
744 STATE          STIME    FMRI
745 offline        16:03:23 svc:/network/nfs/client:default
747 .in -2
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:
757 .in +2
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.
772 .in -2
775 .SH EXIT STATUS
778 The following exit values are returned:
780 .ne 2
782 \fB\fB0\fR\fR
784 .RS 5n
785 Successful command invocation.
789 .ne 2
791 \fB\fB1\fR\fR
793 .RS 5n
794 Fatal error.
798 .ne 2
800 \fB\fB2\fR\fR
802 .RS 5n
803 Invalid command line options were specified.
806 .SH ATTRIBUTES
809 See \fBattributes\fR(5) for descriptions of the following attributes:
814 box;
815 c | c
816 l | l .
817 ATTRIBUTE TYPE  ATTRIBUTE VALUE
819 Interface Stability     See below.
824 Screen output is Uncommitted. The invocation is Committed.
825 .SH SEE ALSO
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)