1 SVCS(1) User Commands SVCS(1)
2
3
4
5 NAME
6 svcs - report service status
7
8 SYNOPSIS
9 svcs [-aHpv?] [-Z | -z zone] [-o col[,col]]... [-R FMRI-instance]...
10 [-sS col]... [FMRI | pattern]...
11
12
13 svcs {-d | -D} [-Hpv?] [-Z | -z zone] [-o col[,col]]... [-sS col]...
14 [FMRI | pattern] ...
15
16
17 svcs [-l | -L] [-vZ] [-z zone] [FMRI | pattern]...
18
19
20 svcs -x [-v] [-Z | -z zone] [FMRI]...
21
22
23 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
29 service instances specified by the arguments. Each instance is listed
30 only once. With no arguments, all enabled service instances, even if
31 temporarily 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
54 OPTIONS
55 The following options are supported:
56
57 -?
58 Displays an extended usage message, including
59 column specifiers.
60
61
62 -a
63 Show all services, even disabled ones. This option
64 has no effect if services are selected.
65
66
67 -d
68 Lists the services or service instances upon which
69 the given service instances depend.
70
71
72 -D
73 Lists the service instances that depend on the
74 given services or service instances.
75
76
77 -H
78 Omits the column headers.
79
80
81 -l
82 (The letter ell.) Displays all available
83 information about the selected services and service
84 instances, with one service attribute displayed for
85 each line. Information for different instances are
86 separated by blank lines.
87
88 The following specific attributes require further
89 explanation:
90
91 dependency
92 Information about a dependency. The
93 grouping and restart_on properties
94 are displayed first and are separated
95 by a forward slash (/). Next, each
96 entity and its state is listed. See
97 smf(5) for information about states.
98 In addition to the standard states,
99 each service dependency can have the
100 following state descriptions:
101
102 absent
103 No such service is
104 defined on the system.
105
106
107 invalid
108 The fault management
109 resource identifier
110 (FMRI) is invalid (see
111 smf(5)).
112
113
114 multiple
115 The entity is a service
116 with multiple instances.
117
118 File dependencies can only have one
119 of the following state descriptions:
120
121 absent
122 No such file on the
123 system.
124
125
126 online
127 The file exists.
128
129 If the file did not exist
130 the last time that
131 svc.startd evaluated the
132 service's dependencies, it
133 can consider the
134 dependency to be
135 unsatisfied. svcadm
136 refresh forces dependency
137 re-evaluation.
138
139
140 unknown
141 stat(2) failed for a
142 reason other than ENOENT.
143
144 See smf(5) for additional details
145 about dependencies, grouping, and
146 restart_on values.
147
148
149 enabled
150 Whether the service is enabled or
151 not, and whether it is enabled or
152 disabled temporarily (until the next
153 system reboot). The former is
154 specified as either true or false,
155 and the latter is designated by the
156 presence of (temporary).
157
158 A service might be temporarily
159 disabled because an administrator has
160 run svcadm disable -t, used svcadm
161 milestone, or booted the system to a
162 specific milestone. See svcadm(1M)
163 for details.
164
165
166
167 -L
168 Display the log file of the selected services and
169 service instances, one per-line.
170
171
172 -o col[,col]...
173 Prints the specified columns. Each col should be a
174 column name. See COLUMNS below for available
175 columns.
176
177
178 -p
179 Lists processes associated with each service
180 instance. A service instance can have no associated
181 processes. The process ID, start time, and command
182 name (PID, STIME, and CMD fields from ps(1)) are
183 displayed for each process.
184
185
186 -R FMRI-instance
187 Selects service instances that have the given
188 service instance as their restarter.
189
190
191 -s col
192 Sorts output by column. col should be a column
193 name. See COLUMNS below for available columns.
194 Multiple -s options behave additively.
195
196
197 -S col
198 Sorts by col in the opposite order as option -s.
199
200
201 -v
202 Without -x or -l, displays verbose columns: STATE,
203 NSTATE, STIME, CTID, and FMRI.
204
205 With -x, displays extra information for each
206 explanation.
207
208 With -l, displays user-visible properties in
209 property groups of type application and their
210 description.
211
212
213 -x
214 Displays explanations for service states.
215
216 Without arguments, the -x option explains the
217 states of services which:
218
219 o are enabled, but are not running.
220
221 o are preventing another enabled service
222 from running.
223
224
225 -z zone
226 Display only the services in the zone. This option
227 is only applicable in the global zone, see
228 zones(5).
229
230
231 -Z
232 Display services from all zones, with an additional
233 column indicating in which zone the service is
234 running. This option is only applicable in the
235 global zone, see zones(5).
236
237
238 OPERANDS
239 The following operands are supported:
240
241 FMRI
242 A fault management resource identifier (FMRI) that
243 specifies one or more instances (see smf(5)). FMRIs
244 can be abbreviated by specifying the instance name, or
245 the trailing portion of the service name. For example,
246 given the FMRI:
247
248 svc:/network/smtp:sendmail
249
250
251 The following are valid abbreviations:
252
253 sendmail
254 :sendmail
255 smtp
256 smtp:sendmail
257 network/smtp
258
259
260 The following are invalid abbreviations:
261
262 mail
263 network
264 network/smt
265
266
267 If the FMRI specifies a service, then the command
268 applies to all instances of that service, except when
269 used with the -D option.
270
271 Abbreviated forms of FMRIs are unstable, and should
272 not be used in scripts or other permanent tools.
273
274
275 pattern
276 A pattern that is matched against the FMRIs of service
277 instances according to the "globbing" rules described
278 by fnmatch(5). If the pattern does not begin with
279 svc:, then svc:/ is prepended. The following is a
280 typical example of a glob pattern:
281
282 qexample% svcs \*keyserv\*
283 STATE STIME FMRI
284 disabled Aug_02 svc:/network/rpc/keyserv:default
285
286
287
288
289 FMRI-instance
290 An FMRI that specifies an instance.
291
292
293 COLUMNS
294 Column names are case insensitive. The default output format is
295 equivalent to "-o state,stime,fmri". The default sorting columns are
296 STATE, STIME, FMRI.
297
298 CTID
299 The primary contract ID for the service instance. Not all
300 instances have valid primary contract IDs.
301
302
303 DESC
304 A brief description of the service, from its template
305 element. A service might not have a description available, in
306 which case a hyphen (-) is used to denote an empty value.
307
308
309 FMRI
310 The FMRI of the service instance.
311
312
313 INST
314 The instance name of the service instance.
315
316
317 NSTA
318 The abbreviated next state of the service instance, as given
319 in the STA column description. A hyphen denotes that the
320 instance is not transitioning. Same as STA otherwise.
321
322
323 NSTATE
324 The next state of the service. A hyphen is used to denote
325 that the instance is not transitioning. Same as STATE
326 otherwise.
327
328
329 SCOPE
330 The scope name of the service instance.
331
332
333 SVC
334 The service name of the service instance.
335
336
337 STA
338 The abbreviated state of the service instance (see smf(5)):
339
340 DGD
341 degraded
342
343
344 DIS
345 disabled
346
347
348 LRC
349 legacy rc*.d script-initiated instance
350
351
352 MNT
353 maintenance
354
355
356 OFF
357 offline
358
359
360 ON
361 online
362
363
364 UN
365 uninitialized
366
367 Absent or unrecognized states are denoted by a question mark
368 (?) character. An asterisk (*) is appended for instances in
369 transition, unless the NSTA or NSTATE column is also being
370 displayed.
371
372 See smf(5) for an explanation of service states.
373
374
375 STATE
376 The state of the service instance. An asterisk is appended
377 for instances in transition, unless the NSTA or NSTATE column
378 is also being displayed.
379
380 See smf(5) for an explanation of service states.
381
382
383 STIME
384 If the service instance entered the current state within the
385 last 24 hours, this column indicates the time that it did so.
386 Otherwise, this column indicates the date on which it did so,
387 printed with underscores (_) in place of blanks.
388
389
390 EXAMPLES
391 Example 1 Displaying the Default Output
392
393
394 This example displays default output:
395
396
397 example% svcs
398 STATE STIME FMRI
399 ...
400 legacy_run 13:25:04 lrc:/etc/rc3_d/S42myscript
401 ...
402 online 13:21:50 svc:/system/svc/restarter:default
403 ...
404 online 13:25:03 svc:/milestone/multi-user:default
405 ...
406 online 13:25:07 svc:/milestone/multi-user-server:default
407 ...
408
409
410
411 Example 2 Listing All Local Instances
412
413
414 This example lists all local instances of the service1 service.
415
416
417 example% svcs -o state,nstate,fmri service1
418 STATE NSTATE FMRI
419 online - svc:/service1:instance1
420 disabled - svc:/service1:instance2
421
422
423
424 Example 3 Listing Verbose Information
425
426
427 This example lists verbose information.
428
429
430 example% svcs -v network/rpc/rstat:udp
431 STATE NSTATE STIME CTID FMRI
432 online - Aug_09 - svc:/network/rpc/rstat:udp
433
434
435
436 Example 4 Listing Detailed Information
437
438
439 This example lists detailed information about all instances of
440 system/service3. Additional fields can be displayed, as appropriate to
441 the managing restarter.
442
443
444 example% svcs -l network/rpc/rstat:udp
445
446 fmri svc:/network/rpc/rstat:udp
447 enabled true
448 state online
449 next_state none
450 restarter svc:/network/inetd:default
451 contract_id
452 dependency require_all/error svc:/network/rpc/bind (online)
453
454
455
456 Example 5 Listing Processes
457
458 example% svcs -p sendmail
459 STATE STIME FMRI
460 online 13:25:13 svc:/network/smtp:sendmail
461 13:25:15 100939 sendmail
462 13:25:15 100940 sendmail
463
464
465
466 Example 6 Explaining Service States Using svcs -x
467
468
469 (a) In this example, svcs -x has identified that the print/server
470 service being disabled is the root cause of two services which are
471 enabled but not online. svcs -xv shows that those services are
472 print/rfc1179 and print/ipp-listener. This situation can be rectified
473 by either enabling print/server or disabling rfc1179 and ipp-listener.
474
475
476 example% svcs -x
477 svc:/application/print/server:default (LP print server)
478 State: disabled since Mon Feb 13 17:56:21 2006
479 Reason: Disabled by an administrator.
480 See: http://illumos.org/msg/SMF-8000-05
481 See: lpsched(1M)
482 Impact: 2 dependent services are not running. (Use -v for list.)
483
484
485
486
487 (b) In this example, NFS is not working:
488
489
490 example$ svcs nfs/client
491 STATE STIME FMRI
492 offline 16:03:23 svc:/network/nfs/client:default
493
494
495
496
497 (c) The following example shows that the problem is nfs/status.
498 nfs/client is waiting because it depends on nfs/nlockmgr, which depends
499 on nfs/status:
500
501
502 example$ svcs -xv nfs/client
503 svc:/network/nfs/client:default (NFS client)
504 State: offline since Mon Feb 27 16:03:23 2006
505 Reason: Service svc:/network/nfs/status:default
506 is not running because a method failed repeatedly.
507 See: http://illumos.org/msg/SMF-8000-GE
508 Path: svc:/network/nfs/client:default
509 svc:/network/nfs/nlockmgr:default
510 svc:/network/nfs/status:default
511 See: man -M /usr/share/man -s 1M mount_nfs
512 See: /var/svc/log/network-nfs-client:default.log
513 Impact: This service is not running.
514
515
516
517 EXIT STATUS
518 The following exit values are returned:
519
520 0
521 Successful command invocation.
522
523
524 1
525 Fatal error.
526
527
528 2
529 Invalid command line options were specified.
530
531
532 ATTRIBUTES
533 See attributes(5) for descriptions of the following attributes:
534
535
536
537
538 +--------------------+-----------------+
539 | ATTRIBUTE TYPE | ATTRIBUTE VALUE |
540 +--------------------+-----------------+
541 |Interface Stability | See below. |
542 +--------------------+-----------------+
543
544
545 Screen output is Uncommitted. The invocation is Committed.
546
547 SEE ALSO
548 ps(1), svcprop(1), svcadm(1M), svccfg(1M), svc.startd(1M), stat(2),
549 libscf(3LIB), attributes(5), fnmatch(5), smf(5), zones(5)
550
551
552
553 April 17, 2011 SVCS(1)
|
1 SVCS(1) User Commands SVCS(1)
2
3 NAME
4 svcs - report service status
5
6 SYNOPSIS
7 svcs [-aHpv?] [-o col[,col]...] [-R FMRI-instance]... [-sS col]...
8 [-z zone|-Z] [FMRI|pattern]...
9 svcs {-d|-D} -Hpv? [-o col[,col]...] [-sS col]... [-z zone|-Z]
10 [FMRI|pattern]...
11 svcs {-l|-L} [-v] [-z zone|-Z] {FMRI|pattern}...
12 svcs -x [-v] [-z zone|-Z] [FMRI]...
13
14 DESCRIPTION
15 The svcs command displays information about service instances as recorded
16 in the service configuration repository.
17
18 The first form of this command prints one-line status listings for
19 service instances specified by the arguments. Each instance is listed
20 only once. With no arguments, all enabled service instances, even if
21 temporarily disabled, are listed with the columns indicated below.
22
23 The second form prints one-line status listings for the dependencies or
24 dependents of the service instances specified by the arguments.
25
26 The third form prints detailed information about specific services and
27 instances.
28
29 The fourth form explains the states of service instances. For each
30 argument, a block of human-readable text is displayed which explains what
31 state the service is in, and why it is in that state. With no arguments,
32 problematic services are described.
33
34 The output of this command can be used appropriately as input to the
35 svcadm(1M) command.
36
37 OPTIONS
38 The following options are supported:
39
40 -? Displays an extended usage message, including column
41 specifiers.
42
43 -a Show all services, even disabled ones. This option has
44 no effect if services are selected.
45
46 -d Lists the services or service instances upon which the
47 given service instances depend.
48
49 -D Lists the service instances that depend on the given
50 services or service instances.
51
52 -H Used for scripting mode. Do not print headers and
53 separate fields by a single tab instead of arbitrary
54 white space.
55
56 -l Displays all available information about the selected
57 services and service instances, with one service
58 attribute displayed for each line. Information for
59 different instances are separated by blank lines.
60
61 The following specific attributes require further
62 explanation:
63
64 dependency Information about a dependency. The
65 grouping and restart_on properties are
66 displayed first and are separated by a
67 forward slash (/). Next, each entity and
68 its state is listed. See smf(5) for
69 information about states. In addition to
70 the standard states, each service
71 dependency can have the following state
72 descriptions:
73
74 absent No such service is defined on the
75 system.
76
77 invalid The fault management resource
78 identifier (FMRI) is invalid (see
79 smf(5)).
80
81 multiple The entity is a service with
82 multiple instances.
83
84 File dependencies can only have one of the
85 following state descriptions:
86
87 absent No such file on the system.
88
89 online The file exists.
90
91 If the file did not exist the last
92 time that svc.startd evaluated the
93 service's dependencies, it can
94 consider the dependency to be
95 unsatisfied. svcadm refresh
96 forces dependency re-evaluation.
97
98 unknown stat(2) failed for a reason other
99 than ENOENT.
100
101 See smf(5) for additional details about
102 dependencies, grouping, and restart_on
103 values.
104
105 enabled Whether the service is enabled or not, and
106 whether it is enabled or disabled
107 temporarily (until the next system reboot).
108 The former is specified as either true or
109 false, and the latter is designated by the
110 presence of (temporary).
111
112 A service might be temporarily disabled
113 because an administrator has run svcadm
114 disable -t, used svcadm milestone, or
115 booted the system to a specific milestone.
116 See svcadm(1M) for details.
117
118 -L Display the log file of the selected services and
119 service instances, one per-line.
120
121 -o col[,col]... Prints the specified columns. Each col should be a
122 column name. See COLUMNS below for available columns.
123
124 -p Lists processes associated with each service instance.
125 A service instance can have no associated processes.
126 The process ID, start time, and command name (PID,
127 STIME, and CMD fields from ps(1)) are displayed for
128 each process.
129
130 -R FMRI-instance Selects service instances that have the given service
131 instance as their restarter.
132
133 -s col Sorts output by column. col should be a column name.
134 See COLUMNS below for available columns. Multiple -s
135 options behave additively.
136
137 -S col Sorts by col in the opposite order as option -s.
138
139 -v Without -x or -l, displays verbose columns: STATE,
140 NSTATE, STIME, CTID, and FMRI.
141
142 With -x, displays extra information for each
143 explanation.
144
145 With -l, displays user-visible properties in property
146 groups of type application and their description.
147
148 -x Displays explanations for service states.
149
150 Without arguments, the -x option explains the states of
151 services which:
152
153 o are enabled, but are not running.
154
155 o are preventing another enabled service from
156 running.
157
158 -z zone Display only the services in the zone. This option is
159 only applicable in the global zone, see zones(5).
160
161 -Z Display services from all zones, with an additional
162 column indicating in which zone the service is running.
163 This option is only applicable in the global zone, see
164 zones(5).
165
166 OPERANDS
167 The following operands are supported:
168
169 FMRI A fault management resource identifier (FMRI) that
170 specifies one or more instances (see smf(5)). FMRIs can
171 be abbreviated by specifying the instance name, or the
172 trailing portion of the service name. For example, given
173 the FMRI svc:/network/smtp:sendmail, the following are
174 valid abbreviations: sendmail :sendmail smtp smtp:sendmail
175 network/smtp, and the following are invalid abbreviations:
176 mail network network/smt.
177
178 If the FMRI specifies a service, then the command applies
179 to all instances of that service, except when used with
180 the -D option.
181
182 Abbreviated forms of FMRIs are unstable, and should not be
183 used in scripts or other permanent tools.
184
185 pattern A pattern that is matched against the FMRI of service
186 instances according to the "globbing" rules described by
187 fnmatch(5). If the pattern does not begin with svc:, then
188 svc:/ is prepended. The following is a typical example of
189 a glob pattern:
190
191 qexample% svcs \*keyserv\*
192 STATE STIME FMRI
193 disabled Aug_02 svc:/network/rpc/keyserv:default
194
195 FMRI-instance An FMRI that specifies an instance.
196
197 COLUMNS
198 Column names are case insensitive. The default output format is
199 equivalent to -o state,stime,fmri. The default sorting columns are
200 STATE, STIME, FMRI.
201
202 CTID The primary contract ID for the service instance. Not all
203 instances have valid primary contract IDs.
204
205 DESC A brief description of the service, from its template element. A
206 service might not have a description available, in which case a
207 hyphen (-) is used to denote an empty value.
208
209 FMRI The FMRI of the service instance.
210
211 INST The instance name of the service instance.
212
213 NSTA The abbreviated next state of the service instance, as given in
214 the STA column description. A hyphen denotes that the instance
215 is not transitioning. Same as STA otherwise.
216
217 NSTATE The next state of the service. A hyphen is used to denote that
218 the instance is not transitioning. Same as STATE otherwise.
219
220 SCOPE The scope name of the service instance.
221
222 SVC The service name of the service instance.
223
224 STA The abbreviated state of the service instance:
225
226 DGD degraded
227
228 DIS disabled
229
230 LRC legacy rc*.d script-initiated instance
231
232 MNT maintenance
233
234 OFF offline
235
236 ON online
237
238 UN uninitialized
239
240 Absent or unrecognized states are denoted by a question mark (?)
241 character. An asterisk (*) is appended for instances in
242 transition, unless the NSTA or NSTATE column is also being
243 displayed.
244
245 STATE The state of the service instance. An asterisk is appended for
246 instances in transition, unless the NSTA or NSTATE column is also
247 being displayed.
248
249 STIME If the service instance entered the current state within the last
250 24 hours, this column indicates the time that it did so.
251 Otherwise, this column indicates the date on which it did so,
252 printed with underscores (_) in place of blanks.
253
254 EXIT STATUS
255 The following exit values are returned:
256
257 0 Successful command invocation.
258
259 1 Fatal error.
260
261 2 Invalid command line options were specified.
262
263 EXAMPLES
264 Example 1 Displaying the Default Output
265 This example displays default output:
266
267 example% svcs
268 STATE STIME FMRI
269 ...
270 legacy_run 13:25:04 lrc:/etc/rc3_d/S42myscript
271 ...
272 online 13:21:50 svc:/system/svc/restarter:default
273 ...
274 online 13:25:03 svc:/milestone/multi-user:default
275 ...
276 online 13:25:07 svc:/milestone/multi-user-server:default
277 ...
278
279 Example 2 Listing All Local Instances
280 This example lists all local instances of the service1 service:
281
282 example% svcs -o state,nstate,fmri service1
283 STATE NSTATE FMRI
284 online - svc:/service1:instance1
285 disabled - svc:/service1:instance2
286
287 Example 3 Listing Verbose Information
288 This example lists verbose information:
289
290 example% svcs -v network/rpc/rstat:udp
291 STATE NSTATE STIME CTID FMRI
292 online - Aug_09 - svc:/network/rpc/rstat:udp
293
294 Example 4 Listing Detailed Information
295 This example lists detailed information about all instances of
296 system/service3. Additional fields can be displayed, as appropriate to
297 the managing restarter.
298
299 example% svcs -l network/rpc/rstat:udp
300
301 fmri svc:/network/rpc/rstat:udp
302 enabled true
303 state online
304 next_state none
305 restarter svc:/network/inetd:default
306 contract_id
307 dependency require_all/error svc:/network/rpc/bind (online)
308
309 Example 5 Listing Processes
310
311 example% svcs -p sendmail
312 STATE STIME FMRI
313 online 13:25:13 svc:/network/smtp:sendmail
314 13:25:15 100939 sendmail
315 13:25:15 100940 sendmail
316
317 Example 6 Explaining Service States Using svcs -x
318
319 1. In this example, svcs -x has identified that the print/server
320 service being disabled is the root cause of two services which are
321 enabled but not online. svcs -xv shows that those services are
322 print/rfc1179 and print/ipp-listener. This situation can be
323 rectified by either enabling print/server or disabling rfc1179 and
324 ipp-listener.
325
326 example% svcs -x
327 svc:/application/print/server:default (LP print server)
328 State: disabled since Mon Feb 13 17:56:21 2006
329 Reason: Disabled by an administrator.
330 See: http://illumos.org/msg/SMF-8000-05
331 See: lpsched(1M)
332 Impact: 2 dependent services are not running. (Use -v for list.)
333
334 2. In this example, NFS is not working:
335
336 example$ svcs nfs/client
337 STATE STIME FMRI
338 offline 16:03:23 svc:/network/nfs/client:default
339
340 3. The following example shows that the problem is nfs/status.
341 nfs/client is waiting because it depends on nfs/nlockmgr, which
342 depends on nfs/status:
343
344 example$ svcs -xv nfs/client
345 svc:/network/nfs/client:default (NFS client)
346 State: offline since Mon Feb 27 16:03:23 2006
347 Reason: Service svc:/network/nfs/status:default
348 is not running because a method failed repeatedly.
349 See: http://illumos.org/msg/SMF-8000-GE
350 Path: svc:/network/nfs/client:default
351 svc:/network/nfs/nlockmgr:default
352 svc:/network/nfs/status:default
353 See: man -M /usr/share/man -s 1M mount_nfs
354 See: /var/svc/log/network-nfs-client:default.log
355 Impact: This service is not running.
356
357 INTERFACE STABILITY
358 Screen output is Uncommitted. The invocation is Committed.
359
360 SEE ALSO
361 ps(1), svcprop(1), svc.startd(1M), svcadm(1M), svccfg(1M), stat(2),
362 libscf(3LIB), attributes(5), fnmatch(5), smf(5), zones(5)
363
364 illumos April 23, 2015 illumos
|