Print this page
7711 SMF: Finish implementing support for degraded state
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
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 13 /usr/sbin/svcadm [-S state] [-v] [-Z | -z zone] disable [-s]
14 14 [{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
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 108 disable [-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 127
128 128 restart [-d] {FMRI | pattern}...
129 129
130 130 Requests that the service instances specified by the operands be
131 131 restarted. This action requires permission to modify the
132 132 "restarter_actions" property group of the service instance (see
133 133 smf_security(5)).
134 134
135 135 This subcommand can restart only those services that are in the
136 136 online or degraded states, as those states are defined in smf(5).
137 137
138 138 If the -d option is specified, the restarter sends a SIGABRT to all
139 139 members of the contract, which should cause a core dump, before
140 140 restarting the service.
141 141
142 142
143 143 refresh {FMRI | pattern}...
144 144
145 145 For each service instance specified by the operands, requests that
146 146 the assigned restarter update the service's running configuration
147 147 snapshot with the values from the current configuration. Some of
148 148 these values take effect immediately (for example, dependency
149 149 changes). Other values do not take effect until the next service
150 150 restart. See the restarter and service documentation for more
151 151 information.
152 152
153 153 If the service is managed by svc.startd(1M), the refresh method
154 154 will be invoked if it exists to request the service reread its own
155 155 configuration. For other restarters, see the restarter
156 156 documentation.
157 157
158 158 This action requires permission to modify the "restarter_actions"
159 159 property group of the service instance (see smf_security(5)).
160 160
161 161
162 162 clear {FMRI | pattern}...
163 163
164 164 For each service instance specified by the operands, if the
165 165 instance is in the maintenance state, signal to the assigned
166 166 restarter that the service has been repaired. If the instance is in
167 167 the degraded state, request that the assigned restarter take the
168 168 service to the online state. This action requires permission to
169 169 modify the "restarter_actions" property group of the service
170 170 instance (see smf_security(5)).
171 171
172 172
173 173 Exceptional Operations
174 174 The following subcommands are used for service development and
175 175 temporary administrative manipulation.
176 176
177 177 mark [-It] instance_state {FMRI | pattern}...
178 178
179 179 If instance_state is "maintenance", then for each service specified
180 180 by the operands, svcadm requests that the assigned restarter place
↓ open down ↓ |
180 lines elided |
↑ open up ↑ |
181 181 the service in the maintenance state. See svc.startd(1M) and
182 182 inetd(1M) for a detailed description of the actions taken for each
183 183 restarter.
184 184
185 185 If instance_state is "degraded", then for services specified by the
186 186 operands in the online state, svcadm requests that the restarters
187 187 assigned to the services move them into the degraded state.
188 188
189 189 If the -I option is specified, the request is flagged as immediate.
190 190
191 - The -t option is only valid for maintenance requests. When this
192 - option is specified, the request is flagged as temporary, and its
193 - effect will only last until the next reboot.
191 + The -t option is mandatory for degrade requests. When this option
192 + is specified, the request is flagged as temporary, and its effect
193 + will only last until the next reboot.
194 194
195 195
196 196 milestone [-d] milestone_FMRI
197 197
198 198 If milestone_FMRI is the keyword "none", all services other than
199 199 the master restarter, svc:/system/svc/restarter:default, will be
200 200 temporarily disabled.
201 201
202 202 If milestone_FMRI is the keyword "all", temporary enable and
203 203 disable requests for all services will be nullified.
204 204
205 205 If milestone_FMRI is one of the following:
206 206
207 207 svc:/milestone/single-user:default
208 208 svc:/milestone/multi-user:default
209 209 svc:/milestone/multi-user-server:default
210 210
211 211
212 212 then temporary enable and disable requests for the indicated
213 213 service and all services it depends on (directly or indirectly)
214 214 will be nullified. All other services will be temporarily disabled.
215 215
216 216 Changing the system's current milestone with the "milestone"
217 217 subcommand will not change the current run level of the system. To
218 218 change the system's run level, invoke /sbin/init directly.
219 219
220 220 This action requires permission to modify the "options_ovr"
221 221 property group of the svc:/system/svc/restarter:default service
222 222 instance (see smf_security(5)).
223 223
224 224 The -d option immediately changes the milestone to the requested
225 225 milestone, as above. Additionally, it makes the specified milestone
226 226 the default boot milestone, which persists across reboot. The
227 227 default milestone is defined by the options/milestone property on
228 228 the master restarter, svc:/system/svc/restarter:default. If this
229 229 property is absent, "all" is the default. This action requires
230 230 permission to modify the "options" property group of the
231 231 svc:/system/svc/restarter:default service instance (see
232 232 smf_security(5)).
233 233
234 234
235 235 Operands
236 236 The following operands are supported:
237 237
238 238 FMRI
239 239 An FMRI that specifies one or more instances. FMRIs can be
240 240 abbreviated by specifying the instance name, or the trailing
241 241 portion of the service name. For example, given the FMRI:
242 242
243 243 svc:/network/smtp:sendmail
244 244
245 245
246 246 All the following are valid abbreviations:
247 247
248 248 sendmail
249 249 :sendmail
250 250 smtp
251 251 smtp:sendmail
252 252 network/smtp
253 253
254 254
255 255 While the following are invalid:
256 256
257 257 mail
258 258 network
259 259 network/smt
260 260
261 261
262 262 If the FMRI specifies a service, then the command applies to
263 263 all instances of that service. Abbreviated forms of FMRIs
264 264 are unstable, and should not be used in scripts or other
265 265 permanent tools.
266 266
267 267
268 268 pattern
269 269 A pattern that is matched against the FMRIs of service
270 270 instances according to the "globbing" rules described by
271 271 fnmatch(5). If the pattern does not begin with "svc:", then
272 272 "svc:/" is prepended.
273 273
274 274
275 275
276 276 If an abbreviated FMRI matches more than one service, a warning message
277 277 is displayed and that operand is ignored. If a pattern matches more
278 278 than one service or instance, the subcommand is applied to all matches.
279 279
280 280 EXAMPLES
281 281 Example 1 Restarting a Service Instance
282 282
283 283
284 284 The following command restarts the NFS server. The full FMRI for the
285 285 default service instance is: svc:/network/nfs/server:default
286 286
287 287
288 288
289 289 However, you can abbreviate the full FMRI as follows:
290 290
291 291
292 292 # svcadm restart nfs/server
293 293
294 294
295 295
296 296 Example 2 Disabling the Standard HTTP Server
297 297
298 298
299 299 The following command disables the standard HTTP server, using an
300 300 abbreviated FMRI:
301 301
302 302
303 303 $ svcadm disable http
304 304
305 305
306 306
307 307 Example 3 Enabling an Instance and Its Dependent Instances
308 308
309 309
310 310 The following command enables the foo:bar instance, and all instances
311 311 on which it depends:
312 312
313 313
314 314 $ svcadm enable -r foo:bar
315 315
316 316
317 317
318 318 Example 4 Synchronously enabling an instance
319 319
320 320
321 321 The following command enables the foo:bar instance. The command will
322 322 not return until the instance comes online or svcadm determines it is
323 323 not possible for the service to come online.
324 324
325 325
326 326 $ svcadm enable -s foo:bar
327 327
328 328
329 329
330 330 Example 5 Restricting and Restoring the Running Services
331 331
332 332
333 333 The following command restricts the running services to single user
334 334 mode:
335 335
336 336
337 337 # svcadm milestone milestone/single-user
338 338
339 339
340 340
341 341
342 342 The following command restores the running services:
343 343
344 344
345 345 # svcadm milestone all
346 346
347 347
348 348
349 349 EXIT STATUS
350 350 The following exit values are returned:
351 351
352 352 0
353 353 Successful completion.
354 354
355 355
356 356 1
357 357 A fatal error occurred. One or more error messages are displayed
358 358 on standard error.
359 359
360 360
361 361 2
362 362 Invalid command line options were specified.
363 363
364 364
365 365 3
366 366 svcadm determined that a service instance that it was waiting for
367 367 could not reach the desired state without administrator
368 368 intervention due to a problem with the service instance itself.
369 369
370 370
371 371 4
372 372 svcadm determined that a service instance that it was waiting for
373 373 could not reach the desired state without administrator
374 374 intervention due to a problem with the service's dependencies.
375 375
376 376
377 377 ATTRIBUTES
378 378 See attributes(5) for descriptions of the following attributes:
379 379
380 380
381 381
382 382
383 383 +--------------------+-----------------+
384 384 | ATTRIBUTE TYPE | ATTRIBUTE VALUE |
385 385 +--------------------+-----------------+
386 386 |Interface Stability | See below. |
387 387 +--------------------+-----------------+
388 388
389 389
390 390 The interactive output is Uncommitted. The invocation and non-
391 391 interactive output are Committed.
392 392
393 393 SEE ALSO
394 394 svcprop(1), svcs(1), inetd(1M), init(1M), svccfg(1M), svc.startd(1M),
395 395 libscf(3LIB), contract(4), attributes(5), smf(5), smf_security(5),
396 396 zones(5)
397 397
398 398 NOTES
399 399 The amount of time svcadm will spend waiting for services and their
400 400 dependencies to change state is implicitly limited by their method
401 401 timeouts. For example, a service using the default restarter whose
402 402 start method hangs will be transitioned to the maintenance state when
403 403 its timeout expires. svcadm will then consider it impossible for this
404 404 service to come online without administrator intervention.
↓ open down ↓ |
201 lines elided |
↑ open up ↑ |
405 405
406 406
407 407 Attempts to synchronously enable a service which depends (directly or
408 408 indirectly) on a file may fail with an exit status indicating that
409 409 dependencies are unsatisfied if the caller does not have the privileges
410 410 necessary to search the directory containing the file. This limitation
411 411 may be removed in a future release.
412 412
413 413
414 414
415 - October 17, 2017 SVCADM(1M)
415 + December 4, 2017 SVCADM(1M)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX