diff --git a/src/daemon.py b/src/daemon.py index 1b97628..76e4206 100755 --- a/src/daemon.py +++ b/src/daemon.py @@ -25,6 +25,13 @@ import subprocess import shlex import logging +try: + from subprocess import DEVNULL # py3k +except ImportError: + import os + DEVNULL = open(os.devnull, 'wb') + + log = logging.getLogger(__name__) class Executor(threading.Thread): @@ -58,8 +65,10 @@ class Executor(threading.Thread): except (OSError, IOError): log.error('Could not open redirection file: %s', self.filename, exc_info=True) return + else: + stdout = DEVNULL try: - subprocess.call(self.command, stdout=stdout) + subprocess.call(self.command, stdout=stdout, stderr=DEVNULL) except: if self.remote: import traceback