User anna started a job that currently has nice value 10. As anna, she runs `renice 5 -p <pid>` to set its nice value to 5. What happens?

LPIC-1 Exam 101-500, objective 103. GNU and Unix commands hard

Machine-checked — no person has signed for it. This question was read against the source cited below by an automated pass, which found no contradiction. That is a weaker claim than it sounds: the same kind of process wrote the question, so it can confirm its own mistake.

Treat it as a good draft rather than as settled fact, and read the source below before you rely on it. It is not used in mock exams here — only questions a person has signed for are.

How these questions are written — where each question comes from, what the verification ledger records, and what happens when one is found wrong.

The options

Correct It fails with a permission error, because lowering a nice value requires root privileges.

Correct. Going from 10 to 5 raises the process's priority, and an unprivileged user may only increase a nice value, never decrease it.

Not correct It succeeds and the process becomes less favourable to the scheduler.

Wrong twice over. Moving from 10 to 5 would make the process MORE favourable, and an unprivileged user is not allowed to make that change at all.

Not correct It succeeds, because a user may always renice their own processes to any value.

Wrong. Ownership lets an unprivileged user raise the nice value of their own processes; it never permits lowering it. That restriction is what stops users from grabbing CPU.

Not correct It succeeds but the change only takes effect for child processes started afterwards.

Wrong. renice changes the nice value of the running process immediately. Children started later inherit the value in effect when they are forked.

Why

Only root (strictly, a process with CAP_SYS_NICE, or a user given room by the RLIMIT_NICE limit) may lower a nice value and so raise priority. An ordinary user can only be nicer: raise the number. This is a one-way ratchet — anna could go from 10 to 15, but not back down to 10 afterwards. Note that the priority given directly as the first argument is always an absolute value; the -n form is absolute too on Linux's util-linux renice, but POSIX and the BSD renice treat -n as a relative increment, so prefer the positional form when in doubt.

Where this comes from

Cited
LPI exam objective 103.6
What it says
Only the superuser may decrease a process's nice value.

Practise this

Reading one question is not practice. The trainer will draw a short set from objective 103 and space the ones you get wrong.

Practise LPIC-1 Exam 101-500

More questions on this objective

All questions on GNU and Unix commands

Practise LPIC-1 Exam 101-500