diff --git a/tools/provision/zulip-dev.conf b/tools/provision/zulip-dev.conf index 77e19b1ff0..778a7f6f35 100644 --- a/tools/provision/zulip-dev.conf +++ b/tools/provision/zulip-dev.conf @@ -2,7 +2,7 @@ [program:zulip-dev] ; The VM is behind NAT (right, right?); we listen on all interfaces so port mapping works correctly in Vagrant -command=bash -c "source /srv/zulip-venv/bin/activate && /srv/zulip/tools/run-dev.py --interface=''" +command=bash -c "source /srv/zulip-venv/bin/activate && exec /srv/zulip/tools/run-dev.py --interface=''" user=vagrant redirect_stderr=true directory=/srv/zulip/ diff --git a/tools/run-dev-queue-processors b/tools/run-dev-queue-processors index e65dc68387..3cd5e19f48 100755 --- a/tools/run-dev-queue-processors +++ b/tools/run-dev-queue-processors @@ -15,6 +15,6 @@ from zerver.worker.queue_processors import get_active_worker_queues queues = get_active_worker_queues() -args = ' '.join(sys.argv[1:]) +args = sys.argv[1:] for queue in queues: - subprocess.Popen('python manage.py process_queue %s %s' %(args, queue), shell=True) + subprocess.Popen(['python', 'manage.py', 'process_queue'] + args + [queue]) diff --git a/tools/run-dev.py b/tools/run-dev.py index d38bee044e..034433df65 100755 --- a/tools/run-dev.py +++ b/tools/run-dev.py @@ -51,7 +51,7 @@ if options.test: else: settings_module = "zproject.settings" -manage_args = '--settings=%s' % (settings_module,) +manage_args = ['--settings=%s' % (settings_module,)] os.environ['DJANGO_SETTINGS_MODULE'] = settings_module sys.path.append(os.path.join(os.path.dirname(__file__), '..')) @@ -66,7 +66,7 @@ os.chdir(os.path.join(os.path.dirname(__file__), '..')) subprocess.check_call('./tools/clean-repo') # Watch for handlebars changes. -subprocess.Popen('./tools/compile-handlebars-templates forever', shell=True) +subprocess.Popen(['./tools/compile-handlebars-templates', 'forever']) # Set up a new process group, so that we can later kill run{server,tornado} # and all of the processes they spawn. @@ -74,15 +74,15 @@ os.setpgrp() # Pass --nostatic because we configure static serving ourselves in # zulip/urls.py. -cmds = ['python manage.py runserver --nostatic %s localhost:%d' - % (manage_args, django_port), - 'python manage.py runtornado %s localhost:%d' - % (manage_args, tornado_port), - './tools/run-dev-queue-processors %s' % (manage_args), - './puppet/zulip/files/postgresql/process_fts_updates'] +cmds = [['python', 'manage.py', 'runserver', '--nostatic'] + + manage_args + ['localhost:%d' % (django_port,)], + ['python', 'manage.py', 'runtornado'] + + manage_args + ['localhost:%d' % (tornado_port,)], + ['./tools/run-dev-queue-processors'] + manage_args, + ['./puppet/zulip/files/postgresql/process_fts_updates']] for cmd in cmds: - subprocess.Popen(cmd, shell=True) + subprocess.Popen(cmd) class Resource(resource.Resource): def getChild(self, name, request):