From d4681e04c1453b0f8ea0847f0ac967f51f51c9e8 Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Fri, 4 Sep 2015 23:07:31 +0300 Subject: [PATCH] fixed relayevent and other subcommands when launched with "-b" --- motioneye/meyectl.py | 8 ++++++-- motioneye/server.py | 1 - 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/motioneye/meyectl.py b/motioneye/meyectl.py index 446a7ab..4197869 100755 --- a/motioneye/meyectl.py +++ b/motioneye/meyectl.py @@ -38,9 +38,13 @@ _LOG_FILE = 'motioneye.log' def find_command(command): - cmd = os.path.abspath(sys.argv[0]) + cmd = sys.argv[0] + if not cmd.startswith('/'): + cmd = os.path.join(os.getcwd(), cmd) + cmd = cmd.replace('-b', '') # remove server-specific options cmd += ' %s ' % command - cmd += ' '.join([pipes.quote(arg) for arg in sys.argv[2:]]) + cmd += ' '.join([pipes.quote(arg) for arg in sys.argv[2:] + if arg not in ['-b']]) return cmd diff --git a/motioneye/server.py b/motioneye/server.py index 4278c60..3de3ce6 100644 --- a/motioneye/server.py +++ b/motioneye/server.py @@ -50,7 +50,6 @@ class Daemon(object): sys.exit(-1) # separate from parent - os.chdir('/') os.setsid() os.umask(0) -- 2.39.5