1svcs(1)                          User Commands                         svcs(1)
2
3
4

NAME

6       svcs - report service status
7

SYNOPSIS

9       svcs [-aHpv?] [-o col[,col]]... [-R FMRI-instance]...
10            [-sS col]... [FMRI | pattern]...
11
12
13       svcs {-d | -D} [-Hpv?] [-o col[,col]]... [-sS col]...
14            [FMRI | pattern] ...
15
16
17       svcs -l [-v] [FMRI | pattern]...
18
19
20       svcs -x [-v] [FMRI]...
21
22

DESCRIPTION

24       The  svcs  command  displays  information  about  service  instances as
25       recorded in the service configuration repository.
26
27
28       The first form of this command prints one-line status listings for ser‐
29       vice instances specified by the arguments. Each instance is listed only
30       once. With no arguments, all enabled service instances, even if  tempo‐
31       rarily disabled, are listed with the columns indicated below.
32
33
34       The second form prints one-line status listings for the dependencies or
35       dependents of the service instances specified by the arguments.
36
37
38       The third form prints detailed information about specific services  and
39       instances.
40
41
42       The  fourth  form  explains  the  states of service instances. For each
43       argument, a block of human-readable text is  displayed  which  explains
44       what  state  the  service  is  in, and why it is in that state. With no
45       arguments, problematic services are described.
46
47
48       Error messages are printed to the standard error stream.
49
50
51       The output of this command can be used appropriately as  input  to  the
52       svcadm(1M) command.
53

OPTIONS

55       The following options are supported:
56
57       -?                  Displays  an extended usage message, including col‐
58                           umn specifiers.
59
60
61       -a                  Show all services, even disabled ones. This  option
62                           has no effect if services are selected.
63
64
65       -d                  Lists  the services or service instances upon which
66                           the given service instances depend.
67
68
69       -D                  Lists the service  instances  that  depend  on  the
70                           given services or service instances.
71
72
73       -H                  Omits the column headers.
74
75
76       -l                  (The  letter  ell.) Displays all available informa‐
77                           tion  about  the  selected  services  and   service
78                           instances, with one service attribute displayed for
79                           each line. Information for different instances  are
80                           separated by blank lines.
81
82                           The  following  specific attributes require further
83                           explanation:
84
85                           dependency    Information about a  dependency.  The
86                                         grouping  and  restart_on  properties
87                                         are displayed first and are separated
88                                         by  a  forward  slash (/). Next, each
89                                         entity and its state is  listed.  See
90                                         smf(5)  for information about states.
91                                         In addition to the  standard  states,
92                                         each  service dependency can have the
93                                         following state descriptions:
94
95                                         absent      No   such   service    is
96                                                     defined on the system.
97
98
99                                         invalid     The    fault   management
100                                                     resource       identifier
101                                                     (FMRI)  is  invalid  (see
102                                                     smf(5)).
103
104
105                                         multiple    The entity is  a  service
106                                                     with multiple instances.
107
108                                         File  dependencies  can only have one
109                                         of the following state descriptions:
110
111                                         absent     No such file on  the  sys‐
112                                                    tem.
113
114
115                                         online     The file exists.
116
117                                                    If  the file did not exist
118                                                    the   last    time    that
119                                                    svc.startd  evaluated  the
120                                                    service's dependencies, it
121                                                    can  consider  the  depen‐
122                                                    dency to  be  unsatisfied.
123                                                    svcadm    refresh   forces
124                                                    dependency re-evaluation.
125
126
127                                         unknown    stat(2) failed for a  rea‐
128                                                    son other than ENOENT.
129
130                                         See  smf(5)  for  additional  details
131                                         about  dependencies,  grouping,   and
132                                         restart_on values.
133
134
135                           enabled       Whether  the  service  is  enabled or
136                                         not, and whether  it  is  enabled  or
137                                         disabled  temporarily (until the next
138                                         system reboot). The former is  speci‐
139                                         fied as either true or false, and the
140                                         latter is designated by the  presence
141                                         of (temporary).
142
143                                         A  service  might be temporarily dis‐
144                                         abled because  an  administrator  has
145                                         run  svcadm  disable  -t, used svcadm
146                                         milestone, or booted the system to  a
147                                         specific  milestone.  See  svcadm(1M)
148                                         for details.
149
150
151
152       -o col[,col]...     Prints the specified columns. Each col should be  a
153                           column  name.  See COLUMNS below for available col‐
154                           umns.
155
156
157       -p                  Lists  processes  associated  with   each   service
158                           instance. A service instance can have no associated
159                           processes. The process ID, start time, and  command
160                           name  (PID,  STIME,  and CMD fields from ps(1)) are
161                           displayed for each process.
162
163
164       -R FMRI-instance    Selects service instances that have the given  ser‐
165                           vice instance as their restarter.
166
167
168       -s col              Sorts  output  by  column.  col  should be a column
169                           name. See COLUMNS below for available columns. Mul‐
170                           tiple -s options behave additively.
171
172
173       -S col              Sorts by col in the opposite order as option -s.
174
175
176       -v                  Without  -x or -l, displays verbose columns: STATE,
177                           NSTATE, STIME, CTID, and FMRI.
178
179                           With -x, displays extra information for each expla‐
180                           nation.
181
182                           With  -l, displays user-visible properties in prop‐
183                           erty groups of type application and their  descrip‐
184                           tion.
185
186
187       -x                  Displays explanations for service states.
188
189                           Without  arguments,  the  -x  option  explains  the
190                           states of services which:
191
192                               o      are enabled, but are not running.
193
194                               o      are preventing another  enabled  service
195                                      from running.
196
197

OPERANDS

199       The following operands are supported:
200
201       FMRI             A  fault  management  resource  identifier (FMRI) that
202                        specifies one or more instances  (see  smf(5)).  FMRIs
203                        can be abbreviated by specifying the instance name, or
204                        the trailing portion of the service name. For example,
205                        given the FMRI:
206
207                          svc:/network/smtp:sendmail
208
209
210                        The following are valid abbreviations:
211
212                          sendmail
213                          :sendmail
214                          smtp
215                          smtp:sendmail
216                          network/smtp
217
218
219                        The following are invalid abbreviations:
220
221                          mail
222                          network
223                          network/smt
224
225
226                        If  the  FMRI  specifies  a  service, then the command
227                        applies to all instances of that service, except  when
228                        used with the -D option.
229
230                        Abbreviated  forms  of  FMRIs are unstable, and should
231                        not be used in scripts or other permanent tools.
232
233
234       pattern          A pattern that is matched against the FMRIs of service
235                        instances  according to the "globbing" rules described
236                        by fnmatch(5). If the  pattern  does  not  begin  with
237                        svc:, then svc:/ is prepended. The following is a typ‐
238                        ical example of a glob pattern:
239
240                          qexample% svcs \*keyserv\*
241                          STATE          STIME     FMRI
242                          disabled       Aug_02    svc:/network/rpc/keyserv:default
243
244
245
246
247       FMRI-instance    An FMRI that specifies an instance.
248
249

COLUMNS

251       Column names are case insensitive. The default output format is equiva‐
252       lent  to  "-o state,stime,fmri". The default sorting columns are STATE,
253       STIME, FMRI.
254
255       CTID      The primary contract ID for the  service  instance.  Not  all
256                 instances have valid primary contract IDs.
257
258
259       DESC      A  brief  description  of the service, from its template ele‐
260                 ment. A service might not have a  description  available,  in
261                 which case a hyphen () is used to denote an empty value.
262
263
264       FMRI      The FMRI of the service instance.
265
266
267       INST      The instance name of the service instance.
268
269
270       NSTA      The  abbreviated next state of the service instance, as given
271                 in the STA column description.  A  hyphen  denotes  that  the
272                 instance is not transitioning. Same as STA otherwise.
273
274
275       NSTATE    The  next  state  of  the service. A hyphen is used to denote
276                 that the instance is not transitioning. Same as STATE  other‐
277                 wise.
278
279
280       SCOPE     The scope name of the service instance.
281
282
283       SVC       The service name of the service instance.
284
285
286       STA       The abbreviated state of the service instance (see smf(5)):
287
288                 DGD    degraded
289
290
291                 DIS    disabled
292
293
294                 LRC    legacy rc*.d script-initiated instance
295
296
297                 MNT    maintenance
298
299
300                 OFF    offline
301
302
303                 ON     online
304
305
306                 UN     uninitialized
307
308                 Absent  or unrecognized states are denoted by a question mark
309                 (?) character. An asterisk (*) is appended for  instances  in
310                 transition,  unless  the  NSTA or NSTATE column is also being
311                 displayed.
312
313                 See smf(5) for an explanation of service states.
314
315
316       STATE     The state of the service instance. An  asterisk  is  appended
317                 for instances in transition, unless the NSTA or NSTATE column
318                 is also being displayed.
319
320                 See smf(5) for an explanation of service states.
321
322
323       STIME     If the service instance entered the current state within  the
324                 last 24 hours, this column indicates the time that it did so.
325                 Otherwise, this column indicates the date on which it did so,
326                 printed with underscores (_) in place of blanks.
327
328

EXAMPLES

330       Example 1 Displaying the Default Output
331
332
333       This example displays default output:
334
335
336         example% svcs
337         STATE          STIME    FMRI
338         ...
339         legacy_run     13:25:04 lrc:/etc/rc3_d/S42myscript
340         ...
341         online         13:21:50 svc:/system/svc/restarter:default
342         ...
343         online         13:25:03 svc:/milestone/multi-user:default
344         ...
345         online         13:25:07 svc:/milestone/multi-user-server:default
346         ...
347
348
349
350       Example 2 Listing All Local Instances
351
352
353       This example lists all local instances of the service1 service.
354
355
356         example% svcs -o state,nstate,fmri service1
357         STATE        NSTATE        FMRI
358         online       -             svc:/service1:instance1
359         disabled     -             svc:/service1:instance2
360
361
362
363       Example 3 Listing Verbose Information
364
365
366       This example lists verbose information.
367
368
369         example% svcs -v network/rpc/rstat:udp
370         STATE          NSTATE        STIME    CTID   FMRI
371         online         -             Aug_09        - svc:/network/rpc/rstat:udp
372
373
374
375       Example 4 Listing Detailed Information
376
377
378       This  example  lists  detailed  information about all instances of sys‐
379       tem/service3. Additional fields can be displayed, as appropriate to the
380       managing restarter.
381
382
383         example% svcs -l network/rpc/rstat:udp
384
385         fmri         svc:/network/rpc/rstat:udp
386         enabled      true
387         state        online
388         next_state   none
389         restarter    svc:/network/inetd:default
390         contract_id
391         dependency   require_all/error svc:/network/rpc/bind (online)
392
393
394
395       Example 5 Listing Processes
396
397         example% svcs -p sendmail
398         STATE          STIME    FMRI
399         online         13:25:13 svc:/network/smtp:sendmail
400                        13:25:15   100939 sendmail
401         13:25:15   100940 sendmail
402
403
404
405       Example 6 Explaining Service States Using svcs -x
406
407
408       (a)  In this example, svcs -x has identified that the print/server ser‐
409       vice being disabled is the root cause of two services which are enabled
410       but  not  online.  svcs -xv shows that those services are print/rfc1179
411       and print/ipp-listener. This  situation  can  be  rectified  by  either
412       enabling print/server or disabling rfc1179 and ipp-listener.
413
414
415         example% svcs -x
416         svc:/application/print/server:default (LP print server)
417          State: disabled since Mon Feb 13 17:56:21 2006
418         Reason: Disabled by an administrator.
419            See: http://sun.com/msg/SMF-8000-05
420            See: lpsched(1M)
421         Impact: 2 dependent services are not running. (Use -v for list.)
422
423
424
425
426       (b) In this example, NFS is not working:
427
428
429         example$ svcs nfs/client
430         STATE          STIME    FMRI
431         offline        16:03:23 svc:/network/nfs/client:default
432
433
434
435
436       (c)  The  following  example  shows  that  the  problem  is nfs/status.
437       nfs/client is waiting because it depends on nfs/nlockmgr, which depends
438       on nfs/status:
439
440
441         example$ svcs -xv nfs/client
442         svc:/network/nfs/client:default (NFS client)
443          State: offline since Mon Feb 27 16:03:23 2006
444         Reason: Service svc:/network/nfs/status:default
445                 is not running because a method failed repeatedly.
446            See: http://sun.com/msg/SMF-8000-GE
447           Path: svc:/network/nfs/client:default
448                   svc:/network/nfs/nlockmgr:default
449                     svc:/network/nfs/status:default
450            See: man -M /usr/share/man -s 1M mount_nfs
451            See: /var/svc/log/network-nfs-client:default.log
452         Impact: This service is not running.
453
454
455

EXIT STATUS

457       The following exit values are returned:
458
459       0    Successful command invocation.
460
461
462       1    Fatal error.
463
464
465       2    Invalid command line options were specified.
466
467

ATTRIBUTES

469       See attributes(5) for descriptions of the following attributes:
470
471
472
473
474       ┌─────────────────────────────┬─────────────────────────────┐
475       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
476       ├─────────────────────────────┼─────────────────────────────┤
477       │Availability                 │SUNWcsu                      │
478       ├─────────────────────────────┼─────────────────────────────┤
479       │Interface Stability          │See below.                   │
480       └─────────────────────────────┴─────────────────────────────┘
481
482
483       Screen output is Uncommitted. The invocation is Committed.
484

SEE ALSO

486       ps(1),  svcprop(1),  svcadm(1M),  svccfg(1M),  svc.startd(1M), stat(2),
487       libscf(3LIB), attributes(5), fnmatch(5), smf(5)
488
489
490
491SunOS 5.11                        6 Nov 2008                           svcs(1)
Impressum