0

I did this

sudo nice -n -1 firefox

to launch Firefox with higher priority and make all subprocesses that are executed at launch inherit that priority but it failed with an error message about Firefox can't be run as root in a regular user account.

I need sudo to use negative nice values but the rest of the command should be run as my regular user.

How can I use negative nice values but still run the program as my regular user?

I don't want to use renice on already launched processes.

d-b
  • 1,891
  • 3
  • 18
  • 30

1 Answers1

1

You have to give the user allowance to put negative nice values. Look at /etc/security/limits.conf or similar and add a line

<username>             -    nice            -20

to get the job done

stoney
  • 1,055
  • Is this the only way? I don't want to give this permission generally (I will forget to remove it when I don't need it anymore and requiring sudo is a good reminder to prevent entering the wrong value). – d-b Feb 06 '23 at 23:16