xref: /openbsd/usr.bin/renice/renice.8 (revision 8529ddd3)
1.\"	$OpenBSD: renice.8,v 1.25 2015/05/15 19:34:31 jmc Exp $
2.\"
3.\" Copyright (c) 1983, 1991, 1993
4.\"	The Regents of the University of California.  All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\" 3. Neither the name of the University nor the names of its contributors
15.\"    may be used to endorse or promote products derived from this software
16.\"    without specific prior written permission.
17.\"
18.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28.\" SUCH DAMAGE.
29.\"
30.\"     from: @(#)renice.8	8.1 (Berkeley) 6/9/93
31.\"
32.Dd $Mdocdate: May 15 2015 $
33.Dt RENICE 8
34.Os
35.Sh NAME
36.Nm renice
37.Nd alter priority of running processes
38.Sh SYNOPSIS
39.Nm renice
40.Oo Fl n Oc Ar increment
41.Op Fl gpu
42.Ar id
43.Sh DESCRIPTION
44.Nm
45alters the scheduling priority of one or more running processes with ID
46.Ar id .
47Processes may be selected by
48process ID,
49process group ID,
50and
51user name or ID.
52If none of the
53.Fl gpu
54options are specified,
55the default is to select by process ID.
56Multiple processes can be specified in a space separated list.
57.Pp
58Users other than the superuser may only alter the priority of
59processes they own,
60and can only monotonically increase their
61.Dq nice value
62within the range 0 to
63.Dv PRIO_MAX
64(20),
65which  prevents overriding administrative fiats.
66The superuser
67may alter the priority of any process
68and set the priority to any value in the range
69.Dv PRIO_MIN
70(\-20)
71to
72.Dv PRIO_MAX .
73.Pp
74Useful priorities are:
7520 (the affected processes will run only when nothing else
76in the system wants to),
770 (the
78.Dq base
79scheduling priority),
80anything negative (to make things go very fast).
81.Pp
82The options are as follows:
83.Bl -tag -width Ds
84.It Fl g
85Alter the scheduling priority of all processes in process group
86.Ar id .
87.It Fl n Ar increment
88A positive or negative decimal integer used to modify the
89scheduling priority.
90For compatibility with historic versions of this utility,
91if
92.Fl n
93is omitted and
94.Ar increment
95is the first argument to
96.Nm ,
97then
98.Ar increment
99is taken as an absolute priority rather than an increment.
100.It Fl p
101Alter the scheduling priority of process
102.Ar id .
103.It Fl u
104Alter the scheduling priority of all processes belonging to user
105.Ar id ,
106which may be a user name or ID.
107.El
108.Sh FILES
109.Bl -tag -width /etc/passwd -compact
110.It Pa /etc/passwd
111for mapping user names to user IDs
112.El
113.Sh EXIT STATUS
114.Ex -std renice
115.Sh EXAMPLES
116The following example
117changes the priority of process IDs 987 and 32,
118and all processes owned by users daemon and root:
119.Bd -literal -offset indent
120# renice -n +1 987 -u daemon root -p 32
121.Ed
122.Sh SEE ALSO
123.Xr nice 1 ,
124.Xr getpriority 2 ,
125.Xr setpriority 2
126.Sh STANDARDS
127The
128.Nm
129utility is compliant with the
130.St -p1003.1-2008
131specification,
132except the way in which processes are specified differs.
133.Pp
134The historical behavior of passing
135.Ar increment
136as an absolute priority is supported for backwards compatibility.
137.Sh HISTORY
138The
139.Nm
140command appeared in
141.Bx 4.0 .
142.Sh BUGS
143Non-superusers cannot increase scheduling priorities of their own processes,
144even if they were the ones that decreased the priorities in the first place.
145