Allow passing absolute nice command. #1619

This commit is contained in:
Clinton Hall 2019-05-31 14:50:49 +12:00 committed by GitHub
commit 5aadbe6945
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -456,7 +456,10 @@ def configure_niceness():
with open(os.devnull, 'w') as devnull:
try:
subprocess.Popen(['nice'], stdout=devnull, stderr=devnull).communicate()
NICENESS.extend(['nice', '-n{0}'.format(int(CFG['Posix']['niceness']))])
if len(CFG['Posix']['niceness'].split(',')) > 1: #Allow passing of absolute command, not just value.
NICENESS.extend(CFG['Posix']['niceness'].split(','))
else:
NICENESS.extend(['nice', '-n{0}'.format(int(CFG['Posix']['niceness']))])
except Exception:
pass
try: