Print this page
4200 prctl(1): Duplicate information in the man page
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/man/man1/prctl.1
+++ new/usr/src/man/man1/prctl.1
1 1 '\" te
2 2 .\" Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved
3 3 .\" 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. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
4 4 .\" See the License for the specific language governing permissions and limitations under the License. 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
5 5 .\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 -.TH PRCTL 1 "Aug 25, 2009"
6 +.TH PRCTL 1 "Oct 30, 2013"
7 7 .SH NAME
8 8 prctl \- get or set the resource controls of running processes, tasks, and
9 9 projects
10 10 .SH SYNOPSIS
11 11 .LP
12 12 .nf
13 13 \fBprctl\fR [\fB-P\fR] [\fB-t\fR [basic | privileged | system]]
14 14 [\fB-n\fR \fIname\fR [\fB-srx\fR] [\fB-v\fR \fIvalue\fR] [\fB-e\fR | \fB-d\fR \fIaction\fR] [\fB-p\fR \fIpid\fR]]
15 15 [\fB-i\fR \fIidtype\fR] \fIid\fR...
16 16 .fi
17 17
18 18 .SH DESCRIPTION
19 19 .sp
20 20 .LP
21 21 The \fBprctl\fR utility allows the examination and modification of the resource
↓ open down ↓ |
5 lines elided |
↑ open up ↑ |
22 22 controls associated with an active process, task, or project on the system. It
23 23 allows access to the basic and privileged limits and the current usage on
24 24 the specified entity.
25 25 .sp
26 26 .LP
27 27 See \fBresource_controls\fR(5) for a description of the resource controls
28 28 supported in the current release of the Solaris operating system.
29 29 .SH OPTIONS
30 30 .sp
31 31 .LP
32 -If none of the \fB-s\fR, \fB-r\fR, \fB-x\fR, \fB-v\fR, \fB-d\fR, or \fB-e\fR
33 -options are specified, the invocation is considered a get operation. Otherwise,
34 -it is considered a modify operation.
35 -.sp
36 -.LP
37 32 The following options are supported:
38 33 .sp
39 34 .ne 2
40 35 .na
41 36 \fB\fB-d\fR | \fB-e\fR \fIaction\fR\fR
42 37 .ad
43 38 .sp .6
44 39 .RS 4n
45 40 Disables (\fB-d\fR) or enables (\fB-e\fR) the specified \fIaction\fR on the
46 41 resource control value specified by \fB-v\fR, \fB-t\fR, and \fB-p\fR. If any of
47 42 the \fB-v\fR, \fB-t\fR, or \fB-p\fR options are unspecified, they match any
48 43 value, privilege, or recipient pid. For example, specifying only \fB-v\fR
49 44 modifies the first resource control with matching value, matching any privilege
50 45 and recipient pid. If no matching resource control value is found, a new value
51 46 is added as if \fB-s\fR were specified.
52 47 .sp
53 48 \fBActions:\fR
54 49 .sp
55 50 .ne 2
56 51 .na
57 52 \fB\fBall\fR\fR
58 53 .ad
59 54 .RS 17n
60 55 This action is only available with \fB-d\fR. It disables all actions. This
61 56 fails on resource control values that have the \fBdeny\fR global flag.
62 57 .RE
63 58
64 59 .sp
65 60 .ne 2
66 61 .na
67 62 \fB\fBdeny\fR\fR
68 63 .ad
69 64 .RS 17n
70 65 Indicates that the resource control attempts to deny granting the resource to
71 66 the process, task, project, or zone on a request for resources in excess of the
72 67 resource control value. \fBdeny\fR actions can not be enabled if the resource
73 68 control has the \fBno-deny\fR global flag. \fBdeny\fR actions can not be
74 69 disabled if the resource control has the \fBdeny\fR global flag.
75 70 .RE
76 71
77 72 .sp
78 73 .ne 2
79 74 .na
80 75 \fB\fBsignal\fR\fR
81 76 .ad
82 77 .RS 17n
83 78 This action is only available with \fB-d\fR. It deactivates the \fBsignal\fR
84 79 action.
85 80 .RE
86 81
87 82 .sp
88 83 .ne 2
89 84 .na
90 85 \fB\fBsignal\fR=\fIsignum\fR\fR
91 86 .ad
92 87 .RS 17n
93 88 In the \fBsignal=\fR\fIsignum\fR action, \fIsignum\fR is a signal number (or
94 89 string representation of a signal). Setting a \fBsignal\fR action on a resource
95 90 control with the \fBno-local-action\fR global flag fails. A limited set of
96 91 signals can be sent. See \fBNOTES\fR for additional details.
97 92 .RE
98 93
99 94 .RE
100 95
101 96 .sp
102 97 .ne 2
103 98 .na
104 99 \fB\fB-i\fR \fIidtype\fR\fR
105 100 .ad
106 101 .sp .6
107 102 .RS 4n
108 103 Specifies the type of the id operands. Valid \fIidtype\fRs are \fBprocess\fR,
109 104 \fBtask\fR, \fBproject\fR, or \fBzone\fR. Also allowed are \fBpid\fR,
110 105 \fBtaskid\fR, \fBprojid\fR, and \fBzoneid\fR. The default id type, if the
111 106 \fB-i\fR option is omitted, is \fBprocess\fR.
112 107 .sp
113 108 For a modify operation, the entity to which id operands are members is the
114 109 target entity. For instance, setting a project resource control on an \fB-i\fR
115 110 \fBprocess\fR sets the resource control on the project to which each given
116 111 process argument is a member.
117 112 .sp
118 113 For a get operation, the resource controls are listed for all entities to which
119 114 the id operands are members. For example, \fB-i\fR \fBtask\fR \fItaskid\fR
120 115 lists the task, project, and zone resource controls for the task, and for the
121 116 project and zone to which that task is a member.
122 117 .RE
123 118
124 119 .sp
125 120 .ne 2
126 121 .na
127 122 \fB\fB-n\fR \fIname\fR\fR
128 123 .ad
129 124 .sp .6
130 125 .RS 4n
131 126 Specifies the name of the resource control to get or set. If the \fIname\fR is
132 127 unspecified, all resource controls are retrieved.
133 128 .RE
134 129
135 130 .sp
136 131 .ne 2
137 132 .na
138 133 \fB\fB-p\fR \fIpid\fR\fR
139 134 .ad
140 135 .sp .6
141 136 .RS 4n
142 137 When manipulating (using \fB-s\fR, \fB-r\fR, \fB-x\fR, \fB-d\fR, or \fB-e\fR) a
143 138 basic task project, or zone resource control values, a recipient \fIpid\fR can
144 139 be specified using \fB-p\fR. When setting a new basic resource control or
145 140 controls on a task, project, or zone, the \fB-p\fR option is required if the
146 141 \fB-i\fR \fIidtype\fR option argument is not \fBprocess\fR.
147 142 .RE
148 143
149 144 .sp
150 145 .ne 2
151 146 .na
152 147 \fB\fB-P\fR\fR
153 148 .ad
154 149 .sp .6
155 150 .RS 4n
156 151 Display resource control values in space delimited format.
157 152 .RE
158 153
159 154 .sp
160 155 .ne 2
161 156 .na
162 157 \fB\fB-r\fR\fR
163 158 .ad
164 159 .sp .6
165 160 .RS 4n
166 161 Replaces the first resource control value (matching with the \fB-t\fR
167 162 \fBprivilege\fR) with the new value specified through the \fB-v\fR option.
168 163 .RE
169 164
170 165 .sp
171 166 .ne 2
172 167 .na
173 168 \fB\fB-s\fR\fR
174 169 .ad
175 170 .sp .6
176 171 .RS 4n
177 172 Set a new resource control value.
178 173 .sp
179 174 This option requires the \fB-v\fR option.
180 175 .sp
181 176 If you do not specify the \fB-t\fR option, basic privilege is used. If you want
182 177 to set a basic task, process, or zone rctl, \fB-p\fR is required. If \fB-e\fR
183 178 or \fB-d\fR are also specified, the action on the new \fBrctl\fR is set as
184 179 well.
185 180 .sp
186 181 For compatibility with prior releases, this option is implied if \fB-v\fR is
187 182 specified, without any of \fB-e\fR, \fB-d\fR, \fB-r\fR, or \fB-x\fR.
188 183 .sp
189 184 See \fBresource_controls\fR(5) for a description of unit modifiers and scaling
190 185 factors you can use to express large values when setting a resource control
191 186 value.
192 187 .RE
193 188
194 189 .sp
195 190 .ne 2
196 191 .na
197 192 \fB\fB-t\fR [ \fBbasic\fR | \fBprivileged\fR | \fBsystem\fR ]\fR
198 193 .ad
199 194 .sp .6
200 195 .RS 4n
201 196 Specifies which resource control type to set. Unless the "lowerable" flag is
202 197 set for a resource control, only invocations by users (or setuid programs) who
203 198 have privileges equivalent to those of root can modify privileged resource
204 199 controls. See \fBrctlblk_set_value\fR(3C) for a description of the
205 200 \fBRCTL_GLOBAL_LOWERABLE\fR flag. If the type is not specified, \fBbasic\fR is
206 201 assumed. For a get operation, the values of all resource control types,
207 202 including \fBsystem\fR, are displayed if no type is specified.
208 203 .RE
209 204
210 205 .sp
211 206 .ne 2
212 207 .na
213 208 \fB\fB-v\fR \fIvalue\fR\fR
214 209 .ad
215 210 .sp .6
216 211 .RS 4n
217 212 Specifies the value for the resource control for a set operation. If no
218 213 \fIvalue\fR is specified, then the modification (deletion, action enabling or
219 214 disabling) is carried out on the lowest-valued resource control with the given
220 215 type.
221 216 .sp
222 217 See \fBresource_controls\fR(5) for a description of unit modifiers and scaling
223 218 factors you can use to express large values when setting a resource control
224 219 value.
225 220 .RE
226 221
227 222 .sp
228 223 .ne 2
229 224 .na
230 225 \fB\fB-x\fR\fR
231 226 .ad
↓ open down ↓ |
185 lines elided |
↑ open up ↑ |
232 227 .sp .6
233 228 .RS 4n
234 229 Deletes the specified resource control value. If the delete option is not
235 230 provided, the default operation of \fBprctl\fR is to modify a resource control
236 231 value of matching value and privilege, or insert a new value with the given
237 232 privilege. The matching criteria are discussed more fully in \fBsetrctl\fR(2).
238 233 .RE
239 234
240 235 .sp
241 236 .LP
242 -If none of the \fB-d\fR, \fB-e\fR, \fB-v\fR, or \fB-x\fR options is specified,
243 -the invocation is considered a get operation.
237 +If none of the \fB-s\fR, \fB-r\fR, \fB-x\fR, \fB-v\fR, \fB-d\fR, or \fB-e\fR
238 +options are specified, the invocation is considered a get operation. Otherwise,
239 +it is considered a modify operation.
244 240 .SH OPERANDS
245 241 .sp
246 242 .LP
247 243 The following operand is supported:
248 244 .sp
249 245 .ne 2
250 246 .na
251 247 \fB\fIid\fR\fR
252 248 .ad
253 249 .RS 6n
254 250 The \fBID\fR of the entity (\fBprocess\fR, \fBtask\fR, \fBproject\fR, or
255 251 \fBzone\fR) to interrogate. If the invoking user's credentials are unprivileged
256 252 and the entity being interrogated possesses different credentials, the
257 253 operation fails. If no \fIid\fR is specified, an error message is returned.
258 254 .RE
259 255
260 256 .SH EXAMPLES
261 257 .LP
262 258 \fBExample 1 \fRDisplaying Current Resource Control Settings
263 259 .sp
264 260 .LP
265 261 The following example displays current resource control settings for a task to
266 262 which the current shell belongs:
267 263
268 264 .sp
269 265 .in +2
270 266 .nf
271 267 example$ ps -o taskid -p $$
272 268 TASKID
273 269 8
274 270 example$ prctl -i task 8
275 271 136150: /bin/ksh
276 272 NAME PRIVILEGE VALUE FLAG ACTION RECIPIENT
277 273 task.max-cpu-time
278 274 usage 8s
279 275 system 18.4Es inf none -
280 276 task.max-lwps
281 277 usage 39
282 278 system 2.15G max deny -
283 279 project.max-contracts
284 280 privileged 10.0K - deny -
285 281 project.max-locked-memory
286 282 usage 0B
287 283 privileged 508MB - deny -
288 284 project.max-port-ids
289 285 privileged 8.19K - deny -
290 286 project.max-shm-memory
291 287 privileged 508MB - deny -
292 288 project.max-shm-ids
293 289 privileged 128 - deny -
294 290 project.max-msg-ids
295 291 privileged 128 - deny -
296 292 project.max-sem-ids
297 293 privileged 128 - deny -
298 294 project.max-crypto-memory
299 295 usage 0B
300 296 privileged 508MB - deny -
301 297 project.max-tasks
302 298 usage 2
303 299 system 2.15G max deny -
304 300 project.max-lwps
305 301 usage 39
306 302 system 2.15G max deny -
307 303 project.cpu-shares
308 304 usage 1
309 305 privileged 1 - none -
310 306 zone.max-shm-memory
311 307 system 16.0EB max deny -
312 308 zone.max-shm-ids
313 309 system 16.8M max deny -
314 310 zone.max-sem-ids
315 311 system 16.8M max deny -
316 312 zone.max-msg-ids
317 313 system 16.8M max deny -
318 314 zone.max-lwps
319 315 system 2.15G max deny -
320 316 zone.cpu-shares
321 317 privileged 1 - none -
322 318 zone.max-locked-memory
323 319 usage 0B
324 320 privileged 508MB - deny -
325 321 .fi
326 322 .in -2
327 323 .sp
328 324
329 325 .LP
330 326 \fBExample 2 \fRDisplaying, Replacing, and Verifying the Value of a Specific
331 327 Control
332 328 .sp
333 329 .LP
334 330 The following examples displays, replaces, and verifies the value of a specific
335 331 control on an existing project:
336 332
337 333 .sp
338 334 .in +2
339 335 .nf
340 336 example# prctl -n project.cpu-shares -i project group.staff
341 337 project: 10: group.staff
342 338 NAME PRIVILEGE VALUE FLAG ACTION RECIPIENT
343 339 project.cpu-shares
344 340 usage 1
345 341 privileged 1 - none -
346 342 system 65.5K max none -
347 343
348 344 example# prctl -n project.cpu-shares -v 10 -r -i project group.staff
349 345 example# prctl -n project.cpu-shares -i project group.staff
350 346 project: 10: group.staff
351 347 NAME PRIVILEGE VALUE FLAG ACTION RECIPIENT
352 348 project.cpu-shares
353 349 usage 10
354 350 privileged 10 - none -
355 351 system 65.5K max none -
356 352 .fi
357 353 .in -2
358 354 .sp
359 355
360 356 .LP
361 357 \fBExample 3 \fRAdjusting Resources
362 358 .sp
363 359 .LP
364 360 The following example uses the \fBproject.max-locked-memory\fR resource.
365 361
366 362 .sp
367 363 .LP
368 364 First, use \fBid\fR \fB-p\fR to find out which project the current shell is a
369 365 member of:
370 366
371 367 .sp
372 368 .in +2
373 369 .nf
374 370 /home/garfield> id -p
375 371 uid=77880(garfield) gid=10(staff) projid=10(group.staff)
376 372 .fi
377 373 .in -2
378 374 .sp
379 375
380 376 .sp
381 377 .LP
382 378 Using the target project, identify the resource limit value before the change:
383 379
384 380 .sp
385 381 .in +2
386 382 .nf
387 383 /home/garfield> prctl -n project.max-locked-memory -i project \e
388 384 group.staff
389 385 project 10: group.staff
390 386 project.max-locked-memory
391 387 privileged 256MB - deny -
392 388 system 16.0EB max deny -
393 389
394 390 current limit is 256 Megabytes.
395 391 .fi
396 392 .in -2
397 393 .sp
398 394
399 395 .sp
400 396 .LP
401 397 Next, adjust the \fBproject.max-locked-memory\fR limit to 300 Megabytes for the
402 398 target project:
403 399
404 400 .sp
405 401 .in +2
406 402 .nf
407 403 # prctl -n project.max-locked-memory -v 300M -r -i project group.staff
408 404 .fi
409 405 .in -2
410 406 .sp
411 407
412 408 .sp
413 409 .LP
414 410 The resource limit value after the change shows a new value of 300 Megabytes:
415 411
416 412 .sp
417 413 .in +2
418 414 .nf
419 415 # prctl -n project.max-locked-memory -i project group.staff
420 416 project 10:group.staff
421 417 project.max-locked-memory
422 418 usage 200MG
423 419 privileged 300MB - deny -
424 420 system 16.0EB max deny -
425 421 .fi
426 422 .in -2
427 423 .sp
428 424
429 425 .LP
430 426 \fBExample 4 \fRModifying CPU Caps for a Project
431 427 .sp
432 428 .LP
433 429 The \fBprctl\fR command can use the \fBproject.cpu-cap\fR resource control (see
434 430 \fBresource_controls\fR(5)) to set and modify CPU caps for a project. (The same
435 431 resource control can be used in the \fB/etc/project\fR file. See
436 432 \fBproject\fR(4)) The following command modifies the CPU cap to limit
437 433 \fBuser.smith\fR to three CPUs:
438 434
439 435 .sp
440 436 .in +2
441 437 .nf
442 438 # \fBprctl -r -t privileged -n project.cpu-cap -v 300 -i project user.smith\fR
443 439 .fi
444 440 .in -2
445 441 .sp
446 442
447 443 .sp
448 444 .LP
449 445 The \fBprctl\fR \fB-r\fR option, used above, is used to dynamically change a
450 446 CPU cap for a project or zone. For example, the following command will change
451 447 the cap set in the preceding command to 80 percent:
452 448
453 449 .sp
454 450 .in +2
455 451 .nf
456 452 # \fBprctl -r -t privileged -n project.cpu-cap -v 80 -i project user.smith\fR
457 453 .fi
458 454 .in -2
459 455 .sp
460 456
461 457 .sp
462 458 .LP
463 459 To remove a CPU cap, enter:
464 460
465 461 .sp
466 462 .in +2
467 463 .nf
468 464 # \fBprctl -x -n project.cpu-cap $$\fR
469 465 .fi
470 466 .in -2
471 467 .sp
472 468
473 469 .LP
474 470 \fBExample 5 \fRModifying CPU Caps for a Zone
475 471 .sp
476 472 .LP
477 473 The \fBprctl\fR command can use the \fBzone.cpu-cap\fR resource control (see
478 474 \fBresource_controls\fR(5)) to set and modify CPU caps for a zone. (The same
479 475 resource control can be manipulated using the \fBzonecfg\fR(1M) command.) The
480 476 following command modifies the CPU cap to limit the global zone to 80 percent
481 477 of a CPU:
482 478
483 479 .sp
484 480 .in +2
485 481 .nf
486 482 # \fBprctl -t privileged -n zone.cpu-cap -v 80 -i zone global\fR
487 483 .fi
488 484 .in -2
489 485 .sp
490 486
491 487 .sp
492 488 .LP
493 489 The cap can be lowered to 50% using:
494 490
495 491 .sp
496 492 .in +2
497 493 .nf
498 494 # \fBprctl -r -t privileged -n zone.cpu-cap -v 50 -i zone global\fR
499 495 .fi
500 496 .in -2
501 497 .sp
502 498
503 499 .SH EXIT STATUS
504 500 .sp
505 501 .LP
506 502 The following exit values are returned:
507 503 .sp
508 504 .ne 2
509 505 .na
510 506 \fB\fB0\fR\fR
511 507 .ad
512 508 .RS 5n
513 509 Success.
514 510 .RE
515 511
516 512 .sp
517 513 .ne 2
518 514 .na
519 515 \fB\fB1\fR\fR
520 516 .ad
521 517 .RS 5n
522 518 Fatal error encountered.
523 519 .RE
524 520
525 521 .sp
526 522 .ne 2
527 523 .na
528 524 \fB\fB2\fR\fR
529 525 .ad
530 526 .RS 5n
531 527 Invalid command line options were specified.
532 528 .RE
533 529
534 530 .SH FILES
535 531 .sp
536 532 .ne 2
537 533 .na
538 534 \fB\fB/proc/pid/*\fR\fR
539 535 .ad
540 536 .RS 15n
541 537 Process information and control files
542 538 .RE
543 539
544 540 .SH ATTRIBUTES
545 541 .sp
546 542 .LP
547 543 See \fBattributes\fR(5) for descriptions of the following attributes:
548 544 .sp
549 545
550 546 .sp
551 547 .TS
552 548 box;
553 549 c | c
554 550 l | l .
555 551 ATTRIBUTE TYPE ATTRIBUTE VALUE
556 552 _
557 553 Interface Stability See below.
558 554 .TE
559 555
560 556 .sp
561 557 .LP
562 558 The command-line syntax is Committed. The human-readable output is Uncommitted.
563 559 The parseable output is Committed.
564 560 .SH SEE ALSO
565 561 .sp
566 562 .LP
567 563 \fBrctladm\fR(1M), \fBzonecfg\fR(1M), \fBsetrctl\fR(2),
568 564 \fBrctlblk_get_local_action\fR(3C), \fBproject\fR(4), \fBattributes\fR(5),
569 565 \fBresource_controls\fR(5)
570 566 .SH NOTES
571 567 .sp
572 568 .LP
573 569 The valid signals that can be set on a resource control block allowing local
574 570 actions are \fBSIGABRT\fR, \fBSIGXRES\fR, \fBSIGHUP\fR, \fBSIGSTOP\fR,
575 571 \fBSIGTERM\fR, and \fBSIGKILL\fR. Additionally, CPU time related controls can
576 572 issue the \fBSIGXCPU\fR signal, and file size related controls can send the
577 573 \fBSIGXFSZ\fR signal.
↓ open down ↓ |
324 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX