renice(C)


renice -- adjust scheduling priorities of running processes

Syntax

renice [ -n increment ] [ -t ] [ -g | -p | -u ] ID ...

renice value [ -t ] [ -g | -p | -u ] ID ...

Description

renice requests that the nice values (used to calculate system scheduling priorities) of one or more running processes be changed.

ID can be a process group ID (pgid), process ID (pid), or a user name or user ID (user) depending on the option selected (-g, -p, or -u). By default, processes are specified by their process IDs.

Only root may set a lower nice value (higher scheduling priority) than the system default value of 20 (see the description of the -n option). To set a higher nice value (lower scheduling priority) than normal on a process, you must have appropriate privileges according to the set-user-ID (not the effective user ID) of the process.

If a user (including root) increases a process' nice value (lowers its priority) without specifying the -t option, this sets a new lower limit for the process' nice value. A user (excluding root) cannot reduce a process' nice value (raise the priority) unless they previously specified the -t option when increasing the process' nice value.

A user (excluding root) cannot reduce a process' nice value below the lower limit currently defined for it. There is no restriction on root's ability to raise and lower the priority of processes.

In the older form of the command, you can specify an absolute nice value (see nice(C)) rather than an increment to the existing nice value.

renice takes the following options:


-g
Interprets all ID or pgid arguments as integer process group IDs.

-n increment
Specifies the amount by which to adjust the nice value of the selected process(es). The value of increment is a positive or negative decimal integer. Positive values of increment increase the nice value (set a lower scheduling priority). Negative values of increment decrease the nice value (set a higher scheduling priority).

-p
Interprets all ID or pid arguments as integer process IDs.

-t
Allows a user to specify that they want to be able to lower a process' nice value (raise its priority). A user (other than root) must specify this option when increasing the nice value in order to be able to reduce the nice value subsequently.

If root specifies this option when increasing the nice value of a user's process, the user will be able to reduce the nice value subsequently.


-u
Interprets all ID or user arguments as decimal user IDs or usernames.

Examples

Adjust the nice value so that the processes with IDs 987 and 32 have a lower scheduling priority which only root can subsequently increase:

renice -n 5 -p 987 32

Adjust the nice value so that the processes with IDs 987 and 32 have a lower scheduling priority which can subsequently be increased:

renice -t -n 5 -p 987 32

Adjust the nice value so that processes currently in the process groups with IDs 324 and 76 have a higher scheduling priority:

renice -n -5 -g 324 76

Adjust the nice value so that processes currently owned by the user with ID 8 and by the user named cosgrove have a lower scheduling priority:

renice -n 4 -u 8 cosgrove

Limitations

If the default nice value plus increment is larger than 39, a nice value of 39 will be used. If a nice value less than zero is requested, zero will be used.

If a user attempts to lower a process' nice value below the value currently permitted (either the default value or a new limit set by previous use of the -t option), renice sets the nice value to the lowest value allowed and fails silently.

See also

nice(C), ps(C)

Standards conformance

renice is conformant with:

ISO/IEC DIS 9945-2:1992, Information technology - Portable Operating System Interface (POSIX) - Part 2: Shell and Utilities (IEEE Std 1003.2-1992);
X/Open CAE Specification, Commands and Utilities, Issue 4, 1992.


© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 03 June 2005