cfengine/core — pull request #1910 by TheDreamer (2014-08-23 15:11:27+00:00)
Title: Make process_select by priority work on FreeBSD.

Ref: http://lkc.me/5P

Wanted something like and (auto-nice daemon), but would also operate on processes owned by root. So, tried to have a CFEngine policy, additional had it make some things even nicer by moving them into the idle priority class. Which meant looking at PRI, since NI isn't meaningful for processes above or below the normal user range.

IE: the processes's NI value stayed the same after it is moved into the idle priority class, so the promise to move matching processes into the idle priority class would never converge. Opted to not expose and parse the rtprio field from ps.... but rather have process_priority() work on PRI.