From 5aadbe694533e7660ec297beb83e9f1590909832 Mon Sep 17 00:00:00 2001 From: Clinton Hall Date: Fri, 31 May 2019 14:50:49 +1200 Subject: [PATCH] Allow passing absolute nice command. #1619 --- core/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/__init__.py b/core/__init__.py index 7fb32140..fe88d6ae 100644 --- a/core/__init__.py +++ b/core/__init__.py @@ -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: