From fcea709bbc229e8f2cbcb679473e234cd57c8719 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Tue, 25 Aug 2015 15:24:23 +0530 Subject: [PATCH] [fix] use environment variable to use custom service manager --- bench/production_setup.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bench/production_setup.py b/bench/production_setup.py index c8a8a5cd..8e149530 100644 --- a/bench/production_setup.py +++ b/bench/production_setup.py @@ -10,11 +10,10 @@ def restart_service(service): elif os.path.basename(get_program(['service']) or '') == 'service': exec_cmd("{service_manager} {service} restart ".format(service_manager='service', service=service)) else: - # look for 'service_manager' and 'service_manager_command' in config.json - config = get_config() - service_manager = config.get("service_manager") + # look for 'service_manager' and 'service_manager_command' in environment + service_manager = os.environ.get("BENCH_SERVICE_MANAGER") if service_manager: - service_manager_command = (config.get("service_manager_command") + service_manager_command = (os.environ.get("BENCH_SERVICE_MANAGER_COMMAND") or "{service_manager} restart {service}").format(service_manager=service_manager, service=service) exec_cmd(service_manager_command)