Using python I can easily increase the current process's niceness:
>>> import os
>>> import psutil
>>> # Use os to increase by 3
>>> os.nice(3)
3
>>> # Use psutil to set to 10
>>> psutil.Process(os.getpid()).nice(10)
>>> psutil.Process(os.getpid()).nice()
10
However, decreasing a process's niceness does not seem to be allowed:
>>> os.nice(-1)
OSError: [Errno 1] Operation not permitted
>>> psutil.Process(os.getpid()).nice(5)
psutil.AccessDenied: psutil.AccessDenied (pid=14955)
What is the correct way to do this? And is the ratchet mechanism a bug or a feature?