]> www.vanbest.org Git - motioneye-debian/commitdiff
fixed relayevent and other subcommands when launched with "-b"
authorCalin Crisan <ccrisan@gmail.com>
Fri, 4 Sep 2015 20:07:31 +0000 (23:07 +0300)
committerCalin Crisan <ccrisan@gmail.com>
Fri, 4 Sep 2015 20:07:31 +0000 (23:07 +0300)
motioneye/meyectl.py
motioneye/server.py

index 446a7ab2765f9a76f36e7e8e244d99b2d1ff9915..4197869edc8ba676d3e3a2b84a219cfc289e86c2 100755 (executable)
@@ -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
 
index 4278c6073ba2b047788a3d39c9e556c03b03d820..3de3ce6e1dee95c0c1d4193488ecc52804a56c18 100644 (file)
@@ -50,7 +50,6 @@ class Daemon(object):
             sys.exit(-1)
 
         # separate from parent
-        os.chdir('/') 
         os.setsid()
         os.umask(0)