From 41f3f7e639100c754b1eee084ba813ead010a869 Mon Sep 17 00:00:00 2001 From: shreyas Date: Wed, 29 Jun 2016 16:45:26 +0530 Subject: [PATCH] [Fix] Fixed disable_production command --- bench/commands/setup.py | 1 + bench/commands/utils.py | 2 -- bench/config/production_setup.py | 9 +++------ 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/bench/commands/setup.py b/bench/commands/setup.py index 12406040..93676b15 100644 --- a/bench/commands/setup.py +++ b/bench/commands/setup.py @@ -93,6 +93,7 @@ def setup_config(): from bench.config.common_site_config import make_config make_config('.') + setup.add_command(setup_sudoers) setup.add_command(setup_nginx) setup.add_command(setup_supervisor) diff --git a/bench/commands/utils.py b/bench/commands/utils.py index f70542e2..a24051e8 100644 --- a/bench/commands/utils.py +++ b/bench/commands/utils.py @@ -135,5 +135,3 @@ def disable_production(): """Disables production environment for the bench.""" from bench.config.production_setup import disable_production disable_production(bench_path='.') - click.echo("Please run 'bench setup procfile'") - click.echo("Run 'bench start' to start development environment") diff --git a/bench/config/production_setup.py b/bench/config/production_setup.py index b9067454..f9e5b851 100755 --- a/bench/config/production_setup.py +++ b/bench/config/production_setup.py @@ -40,19 +40,16 @@ def disable_production(bench_path='.'): if os.path.islink(supervisor_conf): os.unlink(supervisor_conf) - exec_cmd('supervisorctl reread') - exec_cmd('supervisorctl reload') + exec_cmd('sudo supervisorctl reread') + exec_cmd('sudo supervisorctl update') # nginx nginx_conf = '/etc/nginx/conf.d/{bench_name}.conf'.format(bench_name=bench_name) + if os.path.islink(nginx_conf): os.unlink(nginx_conf) service('nginx', 'reload') - if os.environ.get('NO_SERVICE_RESTART'): - return - - service('nginx', 'restart') def service(service, option): if os.path.basename(get_program(['systemctl']) or '') == 'systemctl' and is_running_systemd():