mirror of
https://github.com/frappe/bench.git
synced 2024-11-13 16:56:33 +00:00
[fix] nginx -t check
This commit is contained in:
parent
91de45adf4
commit
c9cdb2c2ee
@ -47,7 +47,7 @@ def check_uid():
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
def cmd_requires_root():
|
def cmd_requires_root():
|
||||||
if len(sys.argv) > 2 and sys.argv[2] in ('production', 'sudoers', 'lets-encrypt', 'fonts'):
|
if len(sys.argv) > 2 and sys.argv[2] in ('production', 'sudoers', 'lets-encrypt', 'fonts', 'reload-nginx'):
|
||||||
return True
|
return True
|
||||||
if len(sys.argv) >= 2 and sys.argv[1] in ('patch', 'renew-lets-encrypt', 'disable-production'):
|
if len(sys.argv) >= 2 and sys.argv[1] in ('patch', 'renew-lets-encrypt', 'disable-production'):
|
||||||
return True
|
return True
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
from bench.utils import get_program, exec_cmd, get_cmd_output, fix_prod_setup_perms, get_bench_name, find_executable
|
from bench.utils import get_program, exec_cmd, get_cmd_output, fix_prod_setup_perms, get_bench_name, find_executable
|
||||||
from bench.config.supervisor import generate_supervisor_config
|
from bench.config.supervisor import generate_supervisor_config
|
||||||
from bench.config.nginx import make_nginx_conf
|
from bench.config.nginx import make_nginx_conf
|
||||||
import os
|
import os, subprocess
|
||||||
|
|
||||||
def setup_production(user, bench_path='.'):
|
def setup_production(user, bench_path='.'):
|
||||||
generate_supervisor_config(bench_path=bench_path, user=user)
|
generate_supervisor_config(bench_path=bench_path, user=user)
|
||||||
@ -99,5 +99,5 @@ def update_supervisor():
|
|||||||
exec_cmd('sudo supervisorctl update')
|
exec_cmd('sudo supervisorctl update')
|
||||||
|
|
||||||
def reload_nginx():
|
def reload_nginx():
|
||||||
exec_cmd(['sudo', find_executable('nginx'), '-t'])
|
subprocess.check_output(['sudo', find_executable('nginx'), '-t'])
|
||||||
service('nginx', 'reload')
|
service('nginx', 'reload')
|
||||||
|
Loading…
Reference in New Issue
Block a user