xref: /minix3/usr.bin/renice/renice.8 (revision 84d9c625bfea59e274550651111ae9edfdc40fbd)
1*84d9c625SLionel Sambuc.\"	$NetBSD: renice.8,v 1.15 2012/12/06 07:52:12 wiz Exp $
2a86753f3SThomas Cort.\"
3a86753f3SThomas Cort.\" Copyright (c) 1983, 1991, 1993
4a86753f3SThomas Cort.\"	The Regents of the University of California.  All rights reserved.
5a86753f3SThomas Cort.\"
6a86753f3SThomas Cort.\" Redistribution and use in source and binary forms, with or without
7a86753f3SThomas Cort.\" modification, are permitted provided that the following conditions
8a86753f3SThomas Cort.\" are met:
9a86753f3SThomas Cort.\" 1. Redistributions of source code must retain the above copyright
10a86753f3SThomas Cort.\"    notice, this list of conditions and the following disclaimer.
11a86753f3SThomas Cort.\" 2. Redistributions in binary form must reproduce the above copyright
12a86753f3SThomas Cort.\"    notice, this list of conditions and the following disclaimer in the
13a86753f3SThomas Cort.\"    documentation and/or other materials provided with the distribution.
14a86753f3SThomas Cort.\" 3. Neither the name of the University nor the names of its contributors
15a86753f3SThomas Cort.\"    may be used to endorse or promote products derived from this software
16a86753f3SThomas Cort.\"    without specific prior written permission.
17a86753f3SThomas Cort.\"
18a86753f3SThomas Cort.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19a86753f3SThomas Cort.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20a86753f3SThomas Cort.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21a86753f3SThomas Cort.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22a86753f3SThomas Cort.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23a86753f3SThomas Cort.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24a86753f3SThomas Cort.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25a86753f3SThomas Cort.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26a86753f3SThomas Cort.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27a86753f3SThomas Cort.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28a86753f3SThomas Cort.\" SUCH DAMAGE.
29a86753f3SThomas Cort.\"
30a86753f3SThomas Cort.\"     from: @(#)renice.8	8.1 (Berkeley) 6/9/93
31a86753f3SThomas Cort.\"
32*84d9c625SLionel Sambuc.Dd December 6, 2012
33a86753f3SThomas Cort.Dt RENICE 8
34a86753f3SThomas Cort.Os
35a86753f3SThomas Cort.Sh NAME
36a86753f3SThomas Cort.Nm renice
37a86753f3SThomas Cort.Nd alter priority of running processes
38a86753f3SThomas Cort.Sh SYNOPSIS
39a86753f3SThomas Cort.Nm
40a86753f3SThomas Cort.Ar priority
41a86753f3SThomas Cort.Oo
42a86753f3SThomas Cort.Op Fl p
43a86753f3SThomas Cort.Ar pid ...
44a86753f3SThomas Cort.Oc
45a86753f3SThomas Cort.Oo
46a86753f3SThomas Cort.Fl g
47a86753f3SThomas Cort.Ar pgrp ...
48a86753f3SThomas Cort.Oc
49a86753f3SThomas Cort.Oo
50a86753f3SThomas Cort.Fl u
51a86753f3SThomas Cort.Ar user ...
52a86753f3SThomas Cort.Oc
53a86753f3SThomas Cort.Nm
54a86753f3SThomas Cort.Fl n
55a86753f3SThomas Cort.Ar increment
56a86753f3SThomas Cort.Oo
57a86753f3SThomas Cort.Op Fl p
58a86753f3SThomas Cort.Ar pid ...
59a86753f3SThomas Cort.Oc
60a86753f3SThomas Cort.Oo
61a86753f3SThomas Cort.Fl g
62a86753f3SThomas Cort.Ar pgrp ...
63a86753f3SThomas Cort.Oc
64a86753f3SThomas Cort.Oo
65a86753f3SThomas Cort.Fl u
66a86753f3SThomas Cort.Ar user ...
67a86753f3SThomas Cort.Oc
68a86753f3SThomas Cort.Sh DESCRIPTION
69a86753f3SThomas Cort.Nm
70a86753f3SThomas Cortalters the
71a86753f3SThomas Cortscheduling priority of one or more running processes.
72a86753f3SThomas CortThe following
73a86753f3SThomas Cort.Ar who
74a86753f3SThomas Cortparameters are interpreted as process ID's, process group
75a86753f3SThomas CortID's, or user names.
76a86753f3SThomas Cort.Nm Ns 'ing
77a86753f3SThomas Corta process group causes all processes in the process group
78a86753f3SThomas Cortto have their scheduling priority altered.
79a86753f3SThomas Cort.Nm Ns 'ing
80a86753f3SThomas Corta user causes all processes owned by the user to have
81a86753f3SThomas Corttheir scheduling priority altered.
82a86753f3SThomas CortBy default, the processes to be affected are specified by
83a86753f3SThomas Corttheir process ID's.
84a86753f3SThomas Cort.Pp
85a86753f3SThomas CortOptions supported by
86a86753f3SThomas Cort.Nm :
87a86753f3SThomas Cort.Bl -tag -width Ds
88a86753f3SThomas Cort.It Fl g
89a86753f3SThomas CortForce
90a86753f3SThomas Cort.Ar who
91a86753f3SThomas Cortparameters to be interpreted as process group ID's.
92a86753f3SThomas Cort.It Fl n
93a86753f3SThomas CortInstead of changing the specified processes to the given priority,
94a86753f3SThomas Cortinterpret the following argument as an increment to be applied to
95a86753f3SThomas Cortthe current priority of each process.
96a86753f3SThomas Cort.It Fl u
97a86753f3SThomas CortForce the
98a86753f3SThomas Cort.Ar who
99a86753f3SThomas Cortparameters to be interpreted as user names.
100a86753f3SThomas Cort.It Fl p
101a86753f3SThomas CortResets the
102a86753f3SThomas Cort.Ar who
103a86753f3SThomas Cortinterpretation to be (the default) process ID's.
104a86753f3SThomas Cort.El
105a86753f3SThomas Cort.Pp
106a86753f3SThomas CortFor example,
107a86753f3SThomas Cort.Bd -literal -offset indent
108a86753f3SThomas Cortrenice +1 987 -u daemon root -p 32
109a86753f3SThomas Cort.Ed
110a86753f3SThomas Cort.Pp
111a86753f3SThomas Cortwould change the priority of process ID's 987 and 32, and
112a86753f3SThomas Cortall processes owned by users daemon and root.
113a86753f3SThomas Cort.Pp
114a86753f3SThomas CortUsers other than the super-user may only alter the priority of
115a86753f3SThomas Cortprocesses they own,
116a86753f3SThomas Cortand can only monotonically increase their ``nice value''
117a86753f3SThomas Cortwithin the range 0 to
118a86753f3SThomas Cort.Dv PRIO_MAX
119a86753f3SThomas Cort(20).
120a86753f3SThomas Cort(This prevents overriding administrative fiats.)
121a86753f3SThomas CortThe super-user
122a86753f3SThomas Cortmay alter the priority of any process
123a86753f3SThomas Cortand set the priority to any value in the range
124a86753f3SThomas Cort.Dv PRIO_MIN
125a86753f3SThomas Cort(\-20)
126a86753f3SThomas Cortto
127a86753f3SThomas Cort.Dv PRIO_MAX .
128a86753f3SThomas Cort.Pp
129a86753f3SThomas CortUseful priorities are:
130a86753f3SThomas Cort0, the ``base'' scheduling priority;
131a86753f3SThomas Cort20, the affected processes will run only when nothing at the base priority
132a86753f3SThomas Cortwants to;
133a86753f3SThomas Cortanything negative, the processes will receive a scheduling preference.
134a86753f3SThomas Cort.Sh FILES
135a86753f3SThomas Cort.Bl -tag -width /etc/passwd -compact
136a86753f3SThomas Cort.It Pa /etc/passwd
137a86753f3SThomas Cortto map user names to user ID's
138a86753f3SThomas Cort.El
139a86753f3SThomas Cort.Sh SEE ALSO
140a86753f3SThomas Cort.Xr nice 1 ,
141*84d9c625SLionel Sambuc.Xr prenice 1 ,
142a86753f3SThomas Cort.Xr getpriority 2 ,
143a86753f3SThomas Cort.Xr setpriority 2
144a86753f3SThomas Cort.Sh HISTORY
145a86753f3SThomas CortThe
146a86753f3SThomas Cort.Nm
147a86753f3SThomas Cortcommand appeared in
148a86753f3SThomas Cort.Bx 4.0 .
149a86753f3SThomas Cort.Sh BUGS
150a86753f3SThomas CortNon super-users can not increase scheduling priorities of their own processes,
151a86753f3SThomas Corteven if they were the ones that decreased the priorities in the first place.
152