Print this page
12721 would like svcadm disable -c
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man1m/svcadm.1m
+++ new/usr/src/man/man1m/svcadm.1m
1 1 '\" te
2 2 .\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved.
3 -.\" Copyright 2019 Joyent, Inc.
3 +.\" Copyright 2020 Joyent, Inc.
4 4 .\" 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.
5 5 .\" 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.
6 6 .\" 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]
7 -.TH SVCADM 1M "Oct 24, 2019"
7 +.TH SVCADM 1M "May 11, 2020"
8 8 .SH NAME
9 9 svcadm \- manipulate service instances
10 10 .SH SYNOPSIS
11 11 .nf
12 12 \fB/usr/sbin/svcadm\fR [\fB-S state\fR] [\fB-v\fR] [\fB-Z\fR | \fB-z\fR \fIzone\fR] enable [\fB-rst\fR]
13 13 [{\fIFMRI\fR | \fIpattern\fR}...]
14 14 .fi
15 15
16 16 .LP
17 17 .nf
18 -\fB/usr/sbin/svcadm\fR [\fB-S state\fR] [\fB-v\fR] [\fB-Z\fR | \fB-z\fR \fIzone\fR] disable [\fB-st\fR]
19 - [{\fIFMRI\fR | \fIpattern\fR}...]
18 +\fB/usr/sbin/svcadm\fR [\fB-S state\fR] [\fB-v\fR] [\fB-Z\fR | \fB-z\fR \fIzone\fR] disable
19 + [\fB-c\fR -\fIcomment\fR] [\fB-st\fR] [{\fIFMRI\fR | \fIpattern\fR}...]
20 20 .fi
21 21
22 22 .LP
23 23 .nf
24 24 \fB/usr/sbin/svcadm\fR [\fB-S state\fR] [\fB-v\fR] [\fB-Z\fR | \fB-z\fR \fIzone\fR] restart [\fB-d\fR]
25 25 [{\fIFMRI\fR | \fIpattern\fR}...]
26 26 .fi
27 27
28 28 .LP
29 29 .nf
30 30 \fB/usr/sbin/svcadm\fR [\fB-S state\fR] [\fB-v\fR] [\fB-Z\fR | \fB-z\fR \fIzone\fR] refresh
31 31 [{\fIFMRI\fR | \fIpattern\fR}...]
32 32 .fi
33 33
34 34 .LP
35 35 .nf
36 36 \fB/usr/sbin/svcadm\fR [\fB-S state\fR] [\fB-v\fR] [\fB-Z\fR | \fB-z\fR \fIzone\fR] clear
37 37 [{\fIFMRI\fR | \fIpattern\fR}...]
38 38 .fi
39 39
40 40 .LP
41 41 .nf
42 42 \fB/usr/sbin/svcadm\fR [\fB-S state\fR] [\fB-v\fR] [\fB-Z\fR | \fB-z\fR \fIzone\fR] mark [\fB-It] \fIinstance_state\fR
43 43 [{\fIFMRI\fR | \fIpattern\fR}...]
44 44 .fi
45 45
46 46 .LP
47 47 .nf
48 48 \fB/usr/sbin/svcadm\fR [\fB-v\fR] milestone [\fB-d\fR] \fImilestone_FMRI\fR
49 49 .fi
50 50
51 51 .SH DESCRIPTION
52 52 \fBsvcadm\fR issues requests for actions on services executing within the
53 53 service management facility (see \fBsmf\fR(5)). Actions for a service are
54 54 carried out by its assigned service restarter agent. The default service
55 55 restarter is \fBsvc.startd\fR (see \fBsvc.startd\fR(1M)).
56 56 .SH OPTIONS
57 57 The following options are supported:
58 58 .sp
59 59 .ne 2
60 60 .na
61 61 \fB-S\fR \fIstate\fR
62 62 .ad
63 63 .RS 20n
64 64 For the subcommands which normally operate on explicit \fIFMRI\fRs or an
65 65 \fIFMRI\fR pattern, the \fB-S\fR option can be used to select all \fIFMRI\fRs
66 66 in the given state.
67 67 .RE
68 68
69 69 .sp
70 70 .ne 2
71 71 .na
72 72 \fB\fB-v\fR\fR
73 73 .ad
74 74 .RS 20n
75 75 Print actions verbosely to standard output.
76 76 .RE
77 77
78 78 .sp
79 79 .ne 2
80 80 .na
81 81 \fB-Z\fR
82 82 .ad
83 83 .RS 20n
84 84 Administer services in all zones. This option is only applicable
85 85 from the global zone, see \fBzones\fR(5).
86 86 .RE
87 87
88 88 .sp
89 89 .ne 2
90 90 .na
91 91 \fB-z\fR \fIzone\fR
92 92 .ad
93 93 .RS 20n
94 94 Administer services in the specified zone. This option is only applicable
95 95 from the global zone, see \fBzones\fR(5).
96 96 .RE
97 97
98 98 .SH SUBCOMMANDS
99 99 .SS "Common Operations"
100 100 The subcommands listed below are used during the typical administration of a
101 101 service instance.
102 102 .sp
103 103 .LP
104 104 For subcommands taking one or more operands, if the operand specifies a service
105 105 (instead of a service instance), and that service has only a single instance,
106 106 \fBsvcadm\fR operates on that instance. If an abbreviated \fIFMRI\fR (a fault
107 107 management resource identifier) matches more than one service or instance, a
108 108 warning message is displayed and that operand is ignored.
109 109 If a pattern matches more than one service or instance, the subcommand is
110 110 applied to all matches. See \fBsmf\fR(5).
111 111 .sp
112 112 .LP
113 113 In the case that the service has more than one instance, \fBsvcadm\fR return a
114 114 non-zero exit status.
115 115 .sp
116 116 .ne 2
117 117 .na
118 118 \fB\fBenable\fR \fB[\fR\fB-rst\fR\fB]\fR {\fIFMRI\fR | \fIpattern\fR}...\fR
119 119 .ad
120 120 .sp .6
121 121 .RS 4n
122 122 Enables the service instances specified by the operands. For each service
123 123 instance, the assigned restarter will try to bring it to the online state. This
124 124 action requires permission to modify the "general" property group of the
125 125 service instance (see \fBsmf_security\fR(5)).
126 126 .sp
127 127 If the \fB-r\fR option is specified, \fBsvcadm\fR enables each service instance
128 128 and recursively enables its dependencies.
129 129 .sp
130 130 If the \fB-s\fR option is specified, \fBsvcadm\fR enables each service instance
131 131 and then waits for each service instance to enter the \fBonline\fR or
132 132 \fBdegraded\fR state. \fBsvcadm\fR will return early if it determines that the
133 133 service cannot reach these states without administrator intervention.
134 134 .sp
↓ open down ↓ |
105 lines elided |
↑ open up ↑ |
135 135 If the \fB-t\fR option is specified, \fBsvcadm\fR temporarily enables each
136 136 service instance. Temporary enable only lasts until reboot. This action
137 137 requires permission to modify the "restarter_actions" property group of the
138 138 service instance (see \fBsmf_security\fR(5)). By default, \fBenable\fR is
139 139 persistent across reboot.
140 140 .RE
141 141
142 142 .sp
143 143 .ne 2
144 144 .na
145 -\fB\fBdisable\fR [\fB-st\fR] {\fIFMRI\fR | \fIpattern\fR}...\fR
145 +\fB\fBdisable\fR [\fB-c\fR \fIcomment\fR] [\fB-st\fR] {\fIFMRI\fR | \fIpattern\fR}...\fR
146 146 .ad
147 147 .sp .6
148 148 .RS 4n
149 149 Disables the service instance specified by the operands. For each service
150 150 instance, the assigned restarter will try to bring it to the disabled state.
151 151 This action requires permission to modify the "general" property group of the
152 152 service instance (see \fBsmf_security\fR(5)).
153 153 .sp
154 154 If the \fB-s\fR option is specified, \fBsvcadm\fR disables each service
155 155 instance and then waits for each service instance to enter the disabled state.
156 156 \fBsvcadm\fR will return early if it determines that the service cannot reach
157 157 this state without administrator intervention.
158 158 .sp
159 159 If the \fB-t\fR option is specified, \fBsvcadm\fR temporarily disables each
160 160 service instance. Temporary disable only lasts until reboot. This action
161 161 requires permission to modify the "restarter_actions" property group of the
162 162 service instance (see \fBsmf_security\fR(5)). By default, \fBdisable\fR is
163 163 persistent across reboot.
164 +.sp
165 +If the \fB-c\fR option is specified, the given free-form comment is recorded
166 +in the (temporary) service configuration under the \fBgeneral/comment\fR
167 +property. This can serve as an administrator reason for disabling the service,
168 +and is reported by \fBsvcs\fR(1).
164 169 .RE
165 170
166 171 .sp
167 172 .ne 2
168 173 .na
169 174 \fB\fBrestart\fR [\fB-d\fR] {\fIFMRI\fR | \fIpattern\fR}...\fR
170 175 .ad
171 176 .sp .6
172 177 .RS 4n
173 178 Requests that the service instances specified by the operands be restarted.
174 179 This action requires permission to modify the "restarter_actions" property
175 180 group of the service instance (see \fBsmf_security\fR(5)).
176 181 .sp
177 182 This subcommand can restart only those services that are in the online or
178 183 degraded states, as those states are defined in \fBsmf\fR(5).
179 184 .sp
180 185 If the \fB-d\fR option is specified, the restarter sends a \fBSIGABRT\fR to all
181 186 members of the contract, which should cause a core dump, before restarting
182 187 the service.
183 188 .RE
184 189
185 190 .sp
186 191 .ne 2
187 192 .na
188 193 \fB\fBrefresh\fR {\fIFMRI\fR | \fIpattern\fR}...\fR
189 194 .ad
190 195 .sp .6
191 196 .RS 4n
192 197 For each service instance specified by the operands, requests that the assigned
193 198 restarter update the service's running configuration snapshot with the values
194 199 from the current configuration. Some of these values take effect immediately
195 200 (for example, dependency changes). Other values do not take effect until the
196 201 next service \fBrestart\fR. See the restarter and service documentation for
197 202 more information.
198 203 .sp
199 204 If the service is managed by \fBsvc.startd\fR(1M), the \fBrefresh\fR method
200 205 will be invoked if it exists to request the service reread its own
201 206 configuration. For other restarters, see the restarter documentation.
202 207 .sp
203 208 This action requires permission to modify the "restarter_actions" property
204 209 group of the service instance (see \fBsmf_security\fR(5)).
205 210 .RE
206 211
207 212 .sp
208 213 .ne 2
209 214 .na
210 215 \fB\fBclear\fR {\fIFMRI\fR | \fIpattern\fR}...\fR
211 216 .ad
212 217 .sp .6
213 218 .RS 4n
214 219 For each service instance specified by the operands, if the instance is in the
215 220 \fBmaintenance\fR state, signal to the assigned restarter that the service has
216 221 been repaired. If the instance is in the \fBdegraded\fR state, request that the
217 222 assigned restarter take the service to the \fBonline\fR state. This action
218 223 requires permission to modify the "restarter_actions" property group of the
219 224 service instance (see \fBsmf_security\fR(5)).
220 225 .RE
221 226
222 227 .SS "Exceptional Operations"
223 228 The following subcommands are used for service development and temporary
224 229 administrative manipulation.
225 230 .sp
226 231 .ne 2
227 232 .na
228 233 \fB\fBmark [\fR\fB-It\fR\fB]\fR \fIinstance_state\fR {\fIFMRI\fR |
229 234 \fIpattern\fR}...\fR
230 235 .ad
231 236 .sp .6
232 237 .RS 4n
233 238 If \fIinstance_state\fR is "maintenance", then for each service specified by
234 239 the operands, \fBsvcadm\fR requests that the assigned restarter place the
235 240 service in the \fBmaintenance\fR state. See \fBsvc.startd\fR(1M) and
236 241 \fBinetd\fR(1M) for a detailed description of the actions taken for each
237 242 restarter.
238 243 .sp
239 244 If \fIinstance_state\fR is "degraded", then for services specified by the
240 245 operands in the online state, \fBsvcadm\fR requests that the restarters
241 246 assigned to the services move them into the \fBdegraded\fR state.
242 247 .sp
243 248 If the \fB-I\fR option is specified, the request is flagged as immediate.
244 249 .sp
245 250 The \fB-t\fR option is only valid for maintenance requests. When this option is
246 251 specified, the request is flagged as temporary, and its effect will only last
247 252 until the next reboot.
248 253 .RE
249 254
250 255 .sp
251 256 .ne 2
252 257 .na
253 258 \fB\fBmilestone\fR [\fB-d\fR] \fImilestone_FMRI\fR\fR
254 259 .ad
255 260 .sp .6
256 261 .RS 4n
257 262 If \fImilestone_FMRI\fR is the keyword "none", all services other than the
258 263 master restarter, \fBsvc:/system/svc/restarter:default\fR, will be temporarily
259 264 disabled.
260 265 .sp
261 266 If \fImilestone_FMRI\fR is the keyword "all", temporary enable and disable
262 267 requests for all services will be nullified.
263 268 .sp
264 269 If \fImilestone_FMRI\fR is one of the following:
265 270 .sp
266 271 .in +2
267 272 .nf
268 273 svc:/milestone/single-user:default
269 274 svc:/milestone/multi-user:default
270 275 svc:/milestone/multi-user-server:default
271 276 .fi
272 277 .in -2
273 278 .sp
274 279
275 280 then temporary enable and disable requests for the indicated service and all
276 281 services it depends on (directly or indirectly) will be nullified. All other
277 282 services will be temporarily disabled.
278 283 .sp
279 284 Changing the system's current milestone with the "milestone" subcommand will
280 285 not change the current run level of the system. To change the system's run
281 286 level, invoke \fB/sbin/init\fR directly.
282 287 .sp
283 288 This action requires permission to modify the "options_ovr" property group of
284 289 the \fBsvc:/system/svc/restarter:default\fR service instance (see
285 290 \fBsmf_security\fR(5)).
286 291 .sp
287 292 The \fB-d\fR option immediately changes the milestone to the requested
288 293 milestone, as above. Additionally, it makes the specified milestone the default
289 294 boot milestone, which persists across reboot. The default milestone is defined
290 295 by the \fBoptions/milestone\fR property on the master restarter,
291 296 \fBsvc:/system/svc/restarter:default\fR. If this property is absent, "all" is
292 297 the default. This action requires permission to modify the "options" property
293 298 group of the \fBsvc:/system/svc/restarter:default\fR service instance (see
294 299 \fBsmf_security\fR(5)).
295 300 .RE
296 301
297 302 .SS "Operands"
298 303 The following operands are supported:
299 304 .sp
300 305 .ne 2
301 306 .na
302 307 \fB\fIFMRI\fR\fR
303 308 .ad
304 309 .RS 11n
305 310 An \fIFMRI\fR that specifies one or more instances. \fIFMRI\fRs can be
306 311 abbreviated by specifying the instance name, or the trailing portion of the
307 312 service name. For example, given the \fIFMRI\fR:
308 313 .sp
309 314 .in +2
310 315 .nf
311 316 svc:/network/smtp:sendmail
312 317 .fi
313 318 .in -2
314 319 .sp
315 320
316 321 All the following are valid abbreviations:
317 322 .sp
318 323 .in +2
319 324 .nf
320 325 sendmail
321 326 :sendmail
322 327 smtp
323 328 smtp:sendmail
324 329 network/smtp
325 330 .fi
326 331 .in -2
327 332 .sp
328 333
329 334 While the following are invalid:
330 335 .sp
331 336 .in +2
332 337 .nf
333 338 mail
334 339 network
335 340 network/smt
336 341 .fi
337 342 .in -2
338 343 .sp
339 344
340 345 If the \fIFMRI\fR specifies a service, then the command applies to all
341 346 instances of that service. Abbreviated forms of \fIFMRI\fRs are unstable, and
342 347 should not be used in scripts or other permanent tools.
343 348 .RE
344 349
345 350 .sp
346 351 .ne 2
347 352 .na
348 353 \fB\fIpattern\fR\fR
349 354 .ad
350 355 .RS 11n
351 356 A pattern that is matched against the \fIFMRIs\fR of service instances
352 357 according to the "globbing" rules described by \fBfnmatch\fR(5). If the pattern
353 358 does not begin with "svc:", then "svc:/" is prepended.
354 359 .RE
355 360
356 361 .sp
357 362 .LP
358 363 If an abbreviated \fIFMRI\fR matches more than one service, a warning message
359 364 is displayed and that operand is ignored.
360 365 If a pattern matches more than one service or instance, the subcommand is
361 366 applied to all matches.
362 367 .SH EXAMPLES
363 368 \fBExample 1 \fRRestarting a Service Instance
364 369 .sp
365 370 .LP
366 371 The following command restarts the \fBNFS\fR server. The full \fIFMRI\fR for
367 372 the default service instance is: \fBsvc:/network/nfs/server:default\fR
368 373
369 374 .sp
370 375 .LP
371 376 However, you can abbreviate the full \fIFMRI\fR as follows:
↓ open down ↓ |
198 lines elided |
↑ open up ↑ |
372 377
373 378 .sp
374 379 .in +2
375 380 .nf
376 381 # svcadm restart nfs/server
377 382 .fi
378 383 .in -2
379 384 .sp
380 385
381 386 .LP
382 -\fBExample 2 \fRDisabling the Standard HTTP Server
387 +\fBExample 2 \fRDisabling a service
383 388 .sp
384 389 .LP
385 -The following command disables the standard HTTP server, using an abbreviated
386 -\fIFMRI\fR:
390 +The following command synchronously disables a service, using an abbreviated
391 +\fIFMRI\fR, and recording a ticket ID as the administrative reason:
387 392
388 393 .sp
389 394 .in +2
390 395 .nf
391 -$ svcadm disable http
396 +$ svcadm disable -c "OPS-1000" -s http
392 397 .fi
393 398 .in -2
394 399 .sp
395 400
396 401 .LP
397 402 \fBExample 3 \fREnabling an Instance and Its Dependent Instances
398 403 .sp
399 404 .LP
400 405 The following command enables the \fBfoo:bar\fR instance, and all instances on
401 406 which it depends:
402 407
403 408 .sp
404 409 .in +2
405 410 .nf
406 411 $ svcadm enable -r foo:bar
407 412 .fi
408 413 .in -2
409 414 .sp
410 415
411 416 .LP
412 417 \fBExample 4 \fRSynchronously enabling an instance
413 418 .sp
414 419 .LP
415 420 The following command enables the \fBfoo:bar\fR instance. The command will not
416 421 return until the instance comes online or \fBsvcadm\fR determines it is not
417 422 possible for the service to come online.
418 423
419 424 .sp
420 425 .in +2
421 426 .nf
422 427 $ svcadm enable -s foo:bar
423 428 .fi
424 429 .in -2
425 430 .sp
426 431
427 432 .LP
428 433 \fBExample 5 \fRRestricting and Restoring the Running Services
429 434 .sp
430 435 .LP
431 436 The following command restricts the running services to single user mode:
432 437
433 438 .sp
434 439 .in +2
435 440 .nf
436 441 # svcadm milestone milestone/single-user
437 442 .fi
438 443 .in -2
439 444 .sp
440 445
441 446 .sp
442 447 .LP
443 448 The following command restores the running services:
444 449
445 450 .sp
446 451 .in +2
447 452 .nf
448 453 # svcadm milestone all
449 454 .fi
450 455 .in -2
451 456 .sp
452 457
453 458 .SH EXIT STATUS
454 459 The following exit values are returned:
455 460 .sp
456 461 .ne 2
457 462 .na
458 463 \fB\fB0\fR\fR
459 464 .ad
460 465 .RS 5n
461 466 Successful completion.
462 467 .RE
463 468
464 469 .sp
465 470 .ne 2
466 471 .na
467 472 \fB\fB1\fR\fR
468 473 .ad
469 474 .RS 5n
470 475 A fatal error occurred. One or more error messages are displayed on standard
471 476 error.
472 477 .RE
473 478
474 479 .sp
475 480 .ne 2
476 481 .na
477 482 \fB\fB2\fR\fR
478 483 .ad
479 484 .RS 5n
480 485 Invalid command line options were specified.
481 486 .RE
482 487
483 488 .sp
484 489 .ne 2
485 490 .na
486 491 \fB\fB3\fR\fR
487 492 .ad
488 493 .RS 5n
489 494 \fBsvcadm\fR determined that a service instance that it was waiting for could
490 495 not reach the desired state without administrator intervention due to a problem
491 496 with the service instance itself.
492 497 .RE
493 498
494 499 .sp
495 500 .ne 2
496 501 .na
497 502 \fB\fB4\fR\fR
498 503 .ad
499 504 .RS 5n
500 505 \fBsvcadm\fR determined that a service instance that it was waiting for could
501 506 not reach the desired state without administrator intervention due to a problem
502 507 with the service's dependencies.
503 508 .RE
504 509
505 510 .SH ATTRIBUTES
506 511 See \fBattributes\fR(5) for descriptions of the following attributes:
507 512 .sp
508 513
509 514 .sp
510 515 .TS
511 516 box;
512 517 c | c
513 518 l | l .
514 519 ATTRIBUTE TYPE ATTRIBUTE VALUE
515 520 _
516 521 Interface Stability See below.
517 522 .TE
518 523
519 524 .sp
520 525 .LP
521 526 The interactive output is Uncommitted. The invocation and non-interactive
522 527 output are Committed.
523 528 .SH SEE ALSO
524 529 \fBsvcprop\fR(1), \fBsvcs\fR(1), \fBinetd\fR(1M), \fBinit\fR(1M),
525 530 \fBsvccfg\fR(1M), \fBsvc.startd\fR(1M), \fBlibscf\fR(3LIB), \fBcontract\fR(4),
526 531 \fBattributes\fR(5), \fBsmf\fR(5), \fBsmf_security\fR(5), \fBzones\fR(5)
527 532 .SH NOTES
528 533 The amount of time \fBsvcadm\fR will spend waiting for services and their
529 534 dependencies to change state is implicitly limited by their method timeouts.
530 535 For example, a service using the default restarter whose start method hangs
531 536 will be transitioned to the maintenance state when its timeout expires.
532 537 \fBsvcadm\fR will then consider it impossible for this service to come online
533 538 without administrator intervention.
534 539 .sp
535 540 .LP
536 541 Attempts to synchronously enable a service which depends (directly or
537 542 indirectly) on a file may fail with an exit status indicating that dependencies
538 543 are unsatisfied if the caller does not have the privileges necessary to search
539 544 the directory containing the file. This limitation may be removed in a future
540 545 release.
↓ open down ↓ |
139 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX