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():