Best way to "renice" a process by name?

Garance A Drosihn drosih at rpi.edu
Tue Sep 26 11:23:41 PDT 2006


At 9:32 AM -0600 9/26/06, Brett Glass wrote:
>
>Is there a "renice by name" utility for FreeBSD (sort of an 
>equivalent of "killall")? I could gin one up, but since this seems 
>like something that people would want to do frequently, find it hard 
>to believe that someone hasn't already written one.

FreeBSD added the `pgrep' command sometime ago.  Your renice-by-name
script would turn into something like:

     renice +2 `pgrep diskd`

(I have not tested that, and you might want to embellish it by adding
some of the other options to the `pgrep' command)

-- 
Garance Alistair Drosehn            =   gad at gilead.netel.rpi.edu
Senior Systems Programmer           or  gad at freebsd.org
Rensselaer Polytechnic Institute    or  drosih at rpi.edu


More information about the freebsd-questions mailing list