2
0
mirror of https://github.com/frappe/bench.git synced 2024-11-14 09:14:04 +00:00

[Fix] Create symlinks for supervisor and nginx only if they do not exist

This commit is contained in:
shreyas 2016-04-04 12:43:33 +05:30
parent b324bc422d
commit a890be44b8

View File

@ -16,9 +16,12 @@ def setup_production(user, bench='.'):
supervisor_conf = os.path.join(get_supervisor_confdir(), '{bench_name}.{extn}'.format( supervisor_conf = os.path.join(get_supervisor_confdir(), '{bench_name}.{extn}'.format(
bench_name=bench_name, extn=supervisor_conf_extn)) bench_name=bench_name, extn=supervisor_conf_extn))
# Check if symlink exists, If not then create it.
if not os.path.islink(supervisor_conf):
os.symlink(os.path.abspath(os.path.join(bench, 'config', 'supervisor.conf')), supervisor_conf)
os.symlink(os.path.abspath(os.path.join(bench, 'config', 'supervisor.conf')), supervisor_conf) if not os.path.islink(nginx_conf):
os.symlink(os.path.abspath(os.path.join(bench, 'config', 'nginx.conf')), nginx_conf) os.symlink(os.path.abspath(os.path.join(bench, 'config', 'nginx.conf')), nginx_conf)
exec_cmd('supervisorctl reload') exec_cmd('supervisorctl reload')
if os.environ.get('NO_SERVICE_RESTART'): if os.environ.get('NO_SERVICE_RESTART'):