'\" te .\" Copyright (c) 2004, Sun Microsystems, Inc. All Rights Reserved .\" Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation.Original documentation from The Open Group can be obtained online at http://www.opengroup.org/bookstore/. .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation.In the following statement, the phrase"this text" refers to portions of the system documentation.Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group.In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard,the original IEEE and The Open Group Standard is the referee document.The original Standard can be obtained online at http://www.opengroup.org/unix/online.html.This notice shall appear on any product containing this material. .TH renice 1 "2004 年 1 月 9 日" "SunOS 5.11" "用户命令" .SH 名称 renice \- 更改运行的进程的优先级 .SH 用法概要 .LP .nf \fBrenice\fR [\fB-n\fR \fIincrement\fR] [\fB-i\fR \fIidtype\fR] \fIID\fR... .fi .LP .nf \fBrenice\fR [\fB-n\fR \fIincrement\fR] [\fB-g\fR | \fB-p\fR | \fB-u\fR] \fIID\fR... .fi .LP .nf \fBrenice\fR \fIpriority\fR [\fB-p\fR] \fIpid\fR... [\fB-g\fR \fIgid\fR]... [\fB-p\fR \fIpid\fR]... [\fB-u\fR \fIuser\fR]... .fi .LP .nf \fBrenice\fR \fIpriority\fR \fB-g\fR \fIgid\fR... [\fB-g\fR \fIgid\fR]... [\fB-p\fR \fIpid\fR]... [\fB-u\fR \fIuser\fR]... .fi .LP .nf \fBrenice\fR \fIpriority\fR \fB-u\fR \fIuser\fR... [\fB-g\fR \fIgid\fR]... [\fB-p\fR \fIpid\fR]... [\fB-u\fR \fIuser\fR]... .fi .SH 描述 .sp .LP \fBrenice\fR 命令更改一个或多个运行的进程的调度优先级。缺省情况下,按进程 \fBID\fR 指定将受影响的进程。 .sp .LP 如果第一个操作数是有效优先级范围(\fB-20\fR 到 \fB20\fR)内的数字,\fBrenice\fR 会将其视为 \fIpriority\fR(与除第一种用法概要形式以外的所有形式相同)。否则,\fBrenice\fR 会将其视为 \fIID\fR(与第一种用法概要形式相同)。 .SS "更改进程优先级" .sp .LP 特权用户以外的用户仅可更改自身所拥有的进程的优先级,并且只能单调地在 \fB0\fR 到 \fB19\fR 范围内增加其“nice 值”。这样可防止覆盖管理命令。特权用户可以更改任何进程的优先级,并将优先级设置为 \fB-20\fR 到 \fB19\fR 范围内的任意值。有用优先级包括:\fB19\fR(仅在系统中的任何其他进程均不希望运行时才运行受影响的进程);\fB0\fR(“基本”调用优先级);以及任意负值(确保操作十分迅速)。\fB20\fR 是一个可接受的 nice 值,但将向下舍入到 \fB19\fR。 .SH 选项 .sp .LP \fBrenice\fR 支持以下选项功能: .RS +4 .TP .ie t \(bu .el o 第一个操作数 \fIpriority\fR 必须在选项前面,并可包含多位数选项。 .RE .RS +4 .TP .ie t \(bu .el o \fB-g\fR、\fB-p\fR 和 \fB-u\fR 选项可分别包含多个选项参数。 .RE .RS +4 .TP .ie t \(bu .el o \fIpid\fR 选项参数可不与其 \fB-p\fR 选项一起使用。 .RE .RS +4 .TP .ie t \(bu .el o \fB-i\fR 选项可用于为 \fBID\fR 列表指定 \fIID\fR 类型。这是使用 \fB-g\fR | \fB-p\fR | \fB-u\fR 语法指定 \fIID\fR 类型的首选项,现已过时。请参见“附注”部分。 .RE .sp .LP 支持以下选项: .sp .ne 2 .mk .na \fB\fB-g\fR\fR .ad .RS 16n .rt 将所有操作数或仅 \fIgid\fR 参数解释为无符号十进制整数进程组 ID。 .RE .sp .ne 2 .mk .na \fB\fB-i\fR\fR .ad .RS 16n .rt 此选项与 \fIID\fR 列表参数共同指定要应用 \fBrenice\fR 命令的进程类。对 \fBID\fR 列表的解释取决于 \fIidtype\fR 的值。有效 \fIidtype\fR 参数包括:\fBpid\fR、\fBpgid\fR、\fBuid\fR、\fBgid\fR、\fB sid\fR、\fBtaskid\fR、\fBprojid\fR 和 \fBzoneid\fR。 .RE .sp .ne 2 .mk .na \fB\fB-n\fR \fIincrement\fR\fR .ad .RS 16n .rt 指定如何调整一个或多个指定进程的系统调度优先级。\fIincrement\fR 选项参数是一个正的或负的十进制整数,将用于修改一个或多个指定进程的系统调度优先级。正 \fIincrement\fR 值会导致系统调度优先级较低。负 \fI increment\fR 值可能需要相应的特权,并会导致系统调度优先级较高。 .RE .sp .ne 2 .mk .na \fB\fB-p\fR\fR .ad .RS 16n .rt 将所有操作数或仅 \fIpid\fR 参数解释为无符号十进制整数进程 \fBID\fR。如果未指定任何选项,则 \fB-p\fR 选项为缺省值。 .RE .sp .ne 2 .mk .na \fB\fB-u\fR\fR .ad .RS 16n .rt 将所有操作数或仅 \fIuser\fR 参数解释为用户。如果某个现有用户的用户名等于操作数,将使用该用户的用户 \fBID\fR 执行进一步的处理。否则,如果操作数表示无符号十进制整数,将用它来作为用户的数字用户 \fBID\fR。 .RE .SH 操作数 .sp .LP 支持下列操作数: .sp .ne 2 .mk .na \fB\fIID\fR\fR .ad .RS 12n .rt 进程 \fBID\fR、进程组 \fBID\fR 或用户名/用户 \fBID\fR,具体取决于选定的选项。 .RE .sp .ne 2 .mk .na \fB\fIpriority\fR\fR .ad .RS 12n .rt 指定的值将被视为实际系统调度优先级,而不是作为现有系统调度优先级的增量。指定高于现有进程优先级的调度优先级可能需要相应的特权。 .RE .SH 示例 .LP \fB示例 1 \fR调整进程 ID 的调度优先级 .sp .LP 调整系统调度优先级,以便确保进程 \fBID\fR \fB987\fR 和 \fB32\fR 具有较低的调度优先级: .sp .in +2 .nf example% \fBrenice -n 5 -p 987 32\fR .fi .in -2 .sp .LP \fB示例 2 \fR调整组 ID 的调度优先级。 .sp .LP 调整系统调度优先级,以便确保组 \fBID\fR \fB324\fR 和 \fB76\fR 具有较高的调度优先级(如果用户具有相应的特权执行此操作): .sp .in +2 .nf example% \fBrenice -n -4 -g 324 76\fR .fi .in -2 .sp .LP \fB示例 3 \fR调整用户 ID 和用户名的调度优先级 .sp .LP 调整系统调度优先级,以便确保数字用户 ID \fB8\fR 和用户 \fBsas\fR 具有较低的调度优先级: .sp .in +2 .nf example% \fBrenice -n 4 -u 8 sas\fR .fi .in -2 .sp .SH 环境变量 .sp .LP 有关影响 \fBrenice\fR 执行的以下环境变量的说明,请参见 \fBenviron\fR(5):\fBLANG\fR、\fBLC_ALL\fR、\fBLC_CTYPE\fR、\fBLC_MESSAGES\fR 和 \fBNLSPATH\fR。 .SH 退出状态 .sp .LP 将返回以下退出值: .sp .ne 2 .mk .na \fB\fB0\fR\fR .ad .RS 6n .rt 成功完成。 .RE .sp .ne 2 .mk .na \fB\fB>0\fR\fR .ad .RS 6n .rt 出现错误。 .RE .SH 文件 .sp .ne 2 .mk .na \fB\fB/etc/passwd\fR\fR .ad .RS 15n .rt 将用户名映射到用户 \fBID\fR .RE .SH 属性 .sp .LP 有关下列属性的说明,请参见 \fBattributes\fR(5): .sp .sp .TS tab() box; cw(2.75i) |cw(2.75i) lw(2.75i) |lw(2.75i) . 属性类型属性值 _ 可用性system/core-os _ 接口稳定性Committed(已确定) _ 标准请参见 \fBstandards\fR(5)。 .TE .SH 另请参见 .sp .LP \fBnice\fR(1)、\fBpasswd\fR(1)、\fBpriocntl\fR(1)、\fBattributes\fR(5)、\fBenviron\fR(5)、\fBstandards\fR(5) .SH 附注 .sp .LP \fBrenice\fR 语法 .sp .in +2 .nf \fBrenice [-n \fIincrement\fR] [-i \fIidtype\fR] \fIID\fR ...\fR .fi .in -2 .sp .sp .LP 优先于旧语法 .sp .in +2 .nf \fBrenice [-n \fIincrement\fR] [-g | -p| -u] \fIID\fR ...\fR .fi .in -2 .sp .sp .LP 现已过时。 .sp .LP 如果将优先级设置为极低的负值,将不能中断进程。 .sp .LP 要重获控制权,必须使优先级高于 \fB0\fR。 .sp .LP 特权用户以外的用户不能提高其自身进程的调度优先级,即使最初由他们降低优先级也是如此。 .sp .LP \fBpriocntl\fR 命令包含 \fBrenice\fR 的函数。