1.\" $OpenBSD: renice.8,v 1.21 2009/02/09 17:15:44 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: February 9 2009 $ 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.Fl n Ar increment 41.Oo 42.Op Fl g 43.Ar pgrp ... 44.Oc 45.Oo 46.Op Fl p 47.Ar pid ... 48.Oc 49.Oo 50.Op Fl u 51.Ar user ... 52.Oc 53.Sh DESCRIPTION 54.Nm 55alters the scheduling priority of one or more running processes by 56.Ar increment . 57Processes may be selected using the parameters 58.Ar pid 59(process ID), 60.Ar pgrp 61(process group ID), 62and 63.Ar user 64(user name or ID). 65If no flag is specified, 66the default is to select by process ID. 67.Pp 68Users other than the superuser may only alter the priority of 69processes they own, 70and can only monotonically increase their 71.Dq nice value 72within the range 0 to 73.Dv PRIO_MAX 74(20). 75(This prevents overriding administrative fiats.) 76The superuser 77may alter the priority of any process 78and set the priority to any value in the range 79.Dv PRIO_MIN 80(\-20) 81to 82.Dv PRIO_MAX . 83.Pp 84Useful priorities are: 8520 (the affected processes will run only when nothing else 86in the system wants to), 870 (the 88.Dq base 89scheduling priority), 90anything negative (to make things go very fast). 91.Pp 92The options are as follows: 93.Bl -tag -width Ds 94.It Fl g Ar pgrp ... 95Alter the scheduling priority of all processes in process group 96.Ar pgrp . 97.It Fl n Ar increment 98A positive or negative decimal integer used to modify the 99scheduling priority. 100.It Fl p Ar pid ... 101Alter the scheduling priority of process 102.Ar pid . 103.It Fl u Ar user ... 104Alter the scheduling priority of all processes belonging to 105.Ar user , 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 EXAMPLES 114The following example 115changes the priority of process IDs 987 and 32, 116and all processes owned by users daemon and root: 117.Bd -literal -offset indent 118# renice -n +1 987 -u daemon root -p 32 119.Ed 120.Sh SEE ALSO 121.Xr nice 1 , 122.Xr getpriority 2 , 123.Xr setpriority 2 124.Sh STANDARDS 125The 126.Nm 127utility is compliant with the 128.St -p1003.1-2008 129specification. 130.Pp 131The historical behavior of passing the increment as the first 132argument is supported for backwards compatibility. 133.Pp 134The arguments to flags 135.Op Fl gpu 136are extensions to that specification. 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