diff --git a/bench/config/supervisor.py b/bench/config/supervisor.py index b11bb8d6..a1b79610 100644 --- a/bench/config/supervisor.py +++ b/bench/config/supervisor.py @@ -29,7 +29,8 @@ def generate_supervisor_config(bench_path, user=None, force=False): "webserver_port": config.get('webserver_port', 8000), "gunicorn_workers": config.get('gunicorn_workers', get_gunicorn_workers()["gunicorn_workers"]), "bench_name": get_bench_name(bench_path), - "background_workers": config.get('background_workers') or 1 + "background_workers": config.get('background_workers') or 1, + "bench_cmd": find_executable('bench') }) conf_path = os.path.join(bench_path, 'config', 'supervisor.conf') diff --git a/bench/config/templates/supervisor.conf b/bench/config/templates/supervisor.conf index a0fbf6a8..a9d06331 100644 --- a/bench/config/templates/supervisor.conf +++ b/bench/config/templates/supervisor.conf @@ -14,7 +14,7 @@ directory={{ sites_dir }} {% if use_rq %} [program:{{ bench_name }}-frappe-schedule] -command=bench schedule +command={{ bench_cmd }} schedule priority=3 autostart=true autorestart=true @@ -24,7 +24,7 @@ user={{ user }} directory={{ bench_dir }} [program:{{ bench_name }}-frappe-default-worker] -command=bench worker --queue default +command={{ bench_cmd }} worker --queue default priority=4 autostart=true autorestart=true @@ -38,7 +38,7 @@ numprocs={{ background_workers }} process_name=%(program_name)s-%(process_num)d [program:{{ bench_name }}-frappe-short-worker] -command=bench worker --queue short +command={{ bench_cmd }} worker --queue short priority=4 autostart=true autorestart=true @@ -52,7 +52,7 @@ numprocs={{ background_workers }} process_name=%(program_name)s-%(process_num)d [program:{{ bench_name }}-frappe-long-worker] -command=bench worker --queue long +command={{ bench_cmd }} worker --queue long priority=4 autostart=true autorestart=true