From: Calin Crisan Date: Fri, 4 Sep 2015 20:07:31 +0000 (+0300) Subject: fixed relayevent and other subcommands when launched with "-b" X-Git-Url: http://www.vanbest.org/gitweb/?a=commitdiff_plain;h=d4681e04c1453b0f8ea0847f0ac967f51f51c9e8;p=motioneye-debian fixed relayevent and other subcommands when launched with "-b" --- 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)