Print this page
12721 would like svcadm disable -c
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man1m/svcadm.1m.man.txt
+++ new/usr/src/man/man1m/svcadm.1m.man.txt
1 1 SVCADM(1M) Maintenance Commands SVCADM(1M)
2 2
↓ open down ↓ |
2 lines elided |
↑ open up ↑ |
3 3
4 4
5 5 NAME
6 6 svcadm - manipulate service instances
7 7
8 8 SYNOPSIS
9 9 /usr/sbin/svcadm [-S state] [-v] [-Z | -z zone] enable [-rst]
10 10 [{FMRI | pattern}...]
11 11
12 12
13 - /usr/sbin/svcadm [-S state] [-v] [-Z | -z zone] disable [-st]
14 - [{FMRI | pattern}...]
13 + /usr/sbin/svcadm [-S state] [-v] [-Z | -z zone] disable
14 + [-c -comment] [-st] [{FMRI | pattern}...]
15 15
16 16
17 17 /usr/sbin/svcadm [-S state] [-v] [-Z | -z zone] restart [-d]
18 18 [{FMRI | pattern}...]
19 19
20 20
21 21 /usr/sbin/svcadm [-S state] [-v] [-Z | -z zone] refresh
22 22 [{FMRI | pattern}...]
23 23
24 24
25 25 /usr/sbin/svcadm [-S state] [-v] [-Z | -z zone] clear
26 26 [{FMRI | pattern}...]
27 27
28 28
29 29 /usr/sbin/svcadm [-S state] [-v] [-Z | -z zone] mark [-It] instance_state
30 30 [{FMRI | pattern}...]
31 31
32 32
33 33 /usr/sbin/svcadm [-v] milestone [-d] milestone_FMRI
34 34
35 35
36 36 DESCRIPTION
37 37 svcadm issues requests for actions on services executing within the
38 38 service management facility (see smf(5)). Actions for a service are
39 39 carried out by its assigned service restarter agent. The default
40 40 service restarter is svc.startd (see svc.startd(1M)).
41 41
42 42 OPTIONS
43 43 The following options are supported:
44 44
45 45 -S state
46 46 For the subcommands which normally operate on
47 47 explicit FMRIs or an FMRI pattern, the -S option
48 48 can be used to select all FMRIs in the given state.
49 49
50 50
51 51 -v
52 52 Print actions verbosely to standard output.
53 53
54 54
55 55 -Z
56 56 Administer services in all zones. This option is
57 57 only applicable from the global zone, see zones(5).
58 58
59 59
60 60 -z zone
61 61 Administer services in the specified zone. This
62 62 option is only applicable from the global zone, see
63 63 zones(5).
64 64
65 65
66 66 SUBCOMMANDS
67 67 Common Operations
68 68 The subcommands listed below are used during the typical administration
69 69 of a service instance.
70 70
71 71
72 72 For subcommands taking one or more operands, if the operand specifies a
73 73 service (instead of a service instance), and that service has only a
74 74 single instance, svcadm operates on that instance. If an abbreviated
75 75 FMRI (a fault management resource identifier) matches more than one
76 76 service or instance, a warning message is displayed and that operand is
77 77 ignored. If a pattern matches more than one service or instance, the
78 78 subcommand is applied to all matches. See smf(5).
79 79
80 80
81 81 In the case that the service has more than one instance, svcadm return
82 82 a non-zero exit status.
83 83
84 84 enable [-rst] {FMRI | pattern}...
85 85
86 86 Enables the service instances specified by the operands. For each
87 87 service instance, the assigned restarter will try to bring it to
88 88 the online state. This action requires permission to modify the
89 89 "general" property group of the service instance (see
90 90 smf_security(5)).
91 91
92 92 If the -r option is specified, svcadm enables each service instance
93 93 and recursively enables its dependencies.
94 94
95 95 If the -s option is specified, svcadm enables each service instance
96 96 and then waits for each service instance to enter the online or
97 97 degraded state. svcadm will return early if it determines that the
↓ open down ↓ |
73 lines elided |
↑ open up ↑ |
98 98 service cannot reach these states without administrator
99 99 intervention.
100 100
101 101 If the -t option is specified, svcadm temporarily enables each
102 102 service instance. Temporary enable only lasts until reboot. This
103 103 action requires permission to modify the "restarter_actions"
104 104 property group of the service instance (see smf_security(5)). By
105 105 default, enable is persistent across reboot.
106 106
107 107
108 - disable [-st] {FMRI | pattern}...
108 + disable [-c comment] [-st] {FMRI | pattern}...
109 109
110 110 Disables the service instance specified by the operands. For each
111 111 service instance, the assigned restarter will try to bring it to
112 112 the disabled state. This action requires permission to modify the
113 113 "general" property group of the service instance (see
114 114 smf_security(5)).
115 115
116 116 If the -s option is specified, svcadm disables each service
117 117 instance and then waits for each service instance to enter the
118 118 disabled state. svcadm will return early if it determines that the
119 119 service cannot reach this state without administrator intervention.
120 120
121 121 If the -t option is specified, svcadm temporarily disables each
122 122 service instance. Temporary disable only lasts until reboot. This
123 123 action requires permission to modify the "restarter_actions"
124 124 property group of the service instance (see smf_security(5)). By
125 125 default, disable is persistent across reboot.
126 126
127 + If the -c option is specified, the given free-form comment is
128 + recorded in the (temporary) service configuration under the
129 + general/comment property. This can serve as an administrator
130 + reason for disabling the service, and is reported by svcs(1).
127 131
132 +
128 133 restart [-d] {FMRI | pattern}...
129 134
130 135 Requests that the service instances specified by the operands be
131 136 restarted. This action requires permission to modify the
132 137 "restarter_actions" property group of the service instance (see
133 138 smf_security(5)).
134 139
135 140 This subcommand can restart only those services that are in the
136 141 online or degraded states, as those states are defined in smf(5).
137 142
138 143 If the -d option is specified, the restarter sends a SIGABRT to all
139 144 members of the contract, which should cause a core dump, before
140 145 restarting the service.
141 146
142 147
143 148 refresh {FMRI | pattern}...
144 149
145 150 For each service instance specified by the operands, requests that
146 151 the assigned restarter update the service's running configuration
147 152 snapshot with the values from the current configuration. Some of
148 153 these values take effect immediately (for example, dependency
149 154 changes). Other values do not take effect until the next service
150 155 restart. See the restarter and service documentation for more
151 156 information.
152 157
153 158 If the service is managed by svc.startd(1M), the refresh method
154 159 will be invoked if it exists to request the service reread its own
155 160 configuration. For other restarters, see the restarter
156 161 documentation.
157 162
158 163 This action requires permission to modify the "restarter_actions"
159 164 property group of the service instance (see smf_security(5)).
160 165
161 166
162 167 clear {FMRI | pattern}...
163 168
164 169 For each service instance specified by the operands, if the
165 170 instance is in the maintenance state, signal to the assigned
166 171 restarter that the service has been repaired. If the instance is in
167 172 the degraded state, request that the assigned restarter take the
168 173 service to the online state. This action requires permission to
169 174 modify the "restarter_actions" property group of the service
170 175 instance (see smf_security(5)).
171 176
172 177
173 178 Exceptional Operations
174 179 The following subcommands are used for service development and
175 180 temporary administrative manipulation.
176 181
177 182 mark [-It] instance_state {FMRI | pattern}...
178 183
179 184 If instance_state is "maintenance", then for each service specified
180 185 by the operands, svcadm requests that the assigned restarter place
181 186 the service in the maintenance state. See svc.startd(1M) and
182 187 inetd(1M) for a detailed description of the actions taken for each
183 188 restarter.
184 189
185 190 If instance_state is "degraded", then for services specified by the
186 191 operands in the online state, svcadm requests that the restarters
187 192 assigned to the services move them into the degraded state.
188 193
189 194 If the -I option is specified, the request is flagged as immediate.
190 195
191 196 The -t option is only valid for maintenance requests. When this
192 197 option is specified, the request is flagged as temporary, and its
193 198 effect will only last until the next reboot.
194 199
195 200
196 201 milestone [-d] milestone_FMRI
197 202
198 203 If milestone_FMRI is the keyword "none", all services other than
199 204 the master restarter, svc:/system/svc/restarter:default, will be
200 205 temporarily disabled.
201 206
202 207 If milestone_FMRI is the keyword "all", temporary enable and
203 208 disable requests for all services will be nullified.
204 209
205 210 If milestone_FMRI is one of the following:
206 211
207 212 svc:/milestone/single-user:default
208 213 svc:/milestone/multi-user:default
209 214 svc:/milestone/multi-user-server:default
210 215
211 216
212 217 then temporary enable and disable requests for the indicated
213 218 service and all services it depends on (directly or indirectly)
214 219 will be nullified. All other services will be temporarily disabled.
215 220
216 221 Changing the system's current milestone with the "milestone"
217 222 subcommand will not change the current run level of the system. To
218 223 change the system's run level, invoke /sbin/init directly.
219 224
220 225 This action requires permission to modify the "options_ovr"
221 226 property group of the svc:/system/svc/restarter:default service
222 227 instance (see smf_security(5)).
223 228
224 229 The -d option immediately changes the milestone to the requested
225 230 milestone, as above. Additionally, it makes the specified milestone
226 231 the default boot milestone, which persists across reboot. The
227 232 default milestone is defined by the options/milestone property on
228 233 the master restarter, svc:/system/svc/restarter:default. If this
229 234 property is absent, "all" is the default. This action requires
230 235 permission to modify the "options" property group of the
231 236 svc:/system/svc/restarter:default service instance (see
232 237 smf_security(5)).
233 238
234 239
235 240 Operands
236 241 The following operands are supported:
237 242
238 243 FMRI
239 244 An FMRI that specifies one or more instances. FMRIs can be
240 245 abbreviated by specifying the instance name, or the trailing
241 246 portion of the service name. For example, given the FMRI:
242 247
243 248 svc:/network/smtp:sendmail
244 249
245 250
246 251 All the following are valid abbreviations:
247 252
248 253 sendmail
249 254 :sendmail
250 255 smtp
251 256 smtp:sendmail
252 257 network/smtp
253 258
254 259
255 260 While the following are invalid:
256 261
257 262 mail
258 263 network
259 264 network/smt
260 265
261 266
262 267 If the FMRI specifies a service, then the command applies to
263 268 all instances of that service. Abbreviated forms of FMRIs
264 269 are unstable, and should not be used in scripts or other
265 270 permanent tools.
266 271
267 272
268 273 pattern
269 274 A pattern that is matched against the FMRIs of service
270 275 instances according to the "globbing" rules described by
271 276 fnmatch(5). If the pattern does not begin with "svc:", then
272 277 "svc:/" is prepended.
273 278
274 279
275 280
276 281 If an abbreviated FMRI matches more than one service, a warning message
277 282 is displayed and that operand is ignored. If a pattern matches more
278 283 than one service or instance, the subcommand is applied to all matches.
279 284
280 285 EXAMPLES
281 286 Example 1 Restarting a Service Instance
282 287
283 288
284 289 The following command restarts the NFS server. The full FMRI for the
285 290 default service instance is: svc:/network/nfs/server:default
↓ open down ↓ |
148 lines elided |
↑ open up ↑ |
286 291
287 292
288 293
289 294 However, you can abbreviate the full FMRI as follows:
290 295
291 296
292 297 # svcadm restart nfs/server
293 298
294 299
295 300
296 - Example 2 Disabling the Standard HTTP Server
301 + Example 2 Disabling a service
297 302
298 303
299 - The following command disables the standard HTTP server, using an
300 - abbreviated FMRI:
304 + The following command synchronously disables a service, using an
305 + abbreviated FMRI, and recording a ticket ID as the administrative
306 + reason:
301 307
302 308
303 - $ svcadm disable http
309 + $ svcadm disable -c "OPS-1000" -s http
304 310
305 311
306 312
307 313 Example 3 Enabling an Instance and Its Dependent Instances
308 314
309 315
310 316 The following command enables the foo:bar instance, and all instances
311 317 on which it depends:
312 318
313 319
314 320 $ svcadm enable -r foo:bar
315 321
316 322
317 323
318 324 Example 4 Synchronously enabling an instance
319 325
320 326
321 327 The following command enables the foo:bar instance. The command will
322 328 not return until the instance comes online or svcadm determines it is
323 329 not possible for the service to come online.
324 330
325 331
326 332 $ svcadm enable -s foo:bar
327 333
328 334
329 335
330 336 Example 5 Restricting and Restoring the Running Services
331 337
332 338
333 339 The following command restricts the running services to single user
334 340 mode:
335 341
336 342
337 343 # svcadm milestone milestone/single-user
338 344
339 345
340 346
341 347
342 348 The following command restores the running services:
343 349
344 350
345 351 # svcadm milestone all
346 352
347 353
348 354
349 355 EXIT STATUS
350 356 The following exit values are returned:
351 357
352 358 0
353 359 Successful completion.
354 360
355 361
356 362 1
357 363 A fatal error occurred. One or more error messages are displayed
358 364 on standard error.
359 365
360 366
361 367 2
362 368 Invalid command line options were specified.
363 369
364 370
365 371 3
366 372 svcadm determined that a service instance that it was waiting for
367 373 could not reach the desired state without administrator
368 374 intervention due to a problem with the service instance itself.
369 375
370 376
371 377 4
372 378 svcadm determined that a service instance that it was waiting for
373 379 could not reach the desired state without administrator
374 380 intervention due to a problem with the service's dependencies.
375 381
376 382
377 383 ATTRIBUTES
378 384 See attributes(5) for descriptions of the following attributes:
379 385
380 386
381 387
382 388
383 389 +--------------------+-----------------+
384 390 | ATTRIBUTE TYPE | ATTRIBUTE VALUE |
385 391 +--------------------+-----------------+
386 392 |Interface Stability | See below. |
387 393 +--------------------+-----------------+
388 394
389 395
390 396 The interactive output is Uncommitted. The invocation and non-
391 397 interactive output are Committed.
392 398
393 399 SEE ALSO
394 400 svcprop(1), svcs(1), inetd(1M), init(1M), svccfg(1M), svc.startd(1M),
395 401 libscf(3LIB), contract(4), attributes(5), smf(5), smf_security(5),
396 402 zones(5)
397 403
398 404 NOTES
399 405 The amount of time svcadm will spend waiting for services and their
400 406 dependencies to change state is implicitly limited by their method
401 407 timeouts. For example, a service using the default restarter whose
402 408 start method hangs will be transitioned to the maintenance state when
403 409 its timeout expires. svcadm will then consider it impossible for this
404 410 service to come online without administrator intervention.
↓ open down ↓ |
91 lines elided |
↑ open up ↑ |
405 411
406 412
407 413 Attempts to synchronously enable a service which depends (directly or
408 414 indirectly) on a file may fail with an exit status indicating that
409 415 dependencies are unsatisfied if the caller does not have the privileges
410 416 necessary to search the directory containing the file. This limitation
411 417 may be removed in a future release.
412 418
413 419
414 420
415 - October 24, 2019 SVCADM(1M)
421 + May 11, 2020 SVCADM(1M)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX