mirror of
https://github.com/frappe/bench.git
synced 2025-01-09 08:30:39 +00:00
[Fix] Corrected the fix to disallow symlink creation for supervisor and nginx config files if they already exist
This commit is contained in:
parent
d4b0e0f70d
commit
76efe0ce79
@ -62,13 +62,16 @@ def setup_production(user, bench='.'):
|
||||
supervisor_conf_filename = 'frappe.conf'
|
||||
|
||||
supervisor_conf_path = os.path.join(get_supervisor_confdir(), supervisor_conf_filename)
|
||||
supervisor_sym_link_path = os.path.abspath(os.path.join(bench, 'config', 'supervisor.conf'))
|
||||
|
||||
nginx_conf_path = '/etc/nginx/conf.d/frappe.conf'
|
||||
nginx_sym_link_path = os.path.abspath(os.path.join(bench, 'config', 'nginx.conf'))
|
||||
|
||||
if not os.path.exists(supervisor_conf_path):
|
||||
os.symlink(os.path.abspath(os.path.join(bench, 'config', 'supervisor.conf')), supervisor_conf_path)
|
||||
if not os.path.exists(supervisor_sym_link_path):
|
||||
os.symlink(supervisor_sym_link_path, supervisor_conf_path)
|
||||
|
||||
if not os.path.exists(nginx_conf_path):
|
||||
os.symlink(os.path.abspath(os.path.join(bench, 'config', 'nginx.conf')), nginx_conf_path)
|
||||
if not os.path.exists(nginx_sym_link_path):
|
||||
os.symlink(supervisor_sym_link_path, nginx_conf_path)
|
||||
|
||||
exec_cmd('supervisorctl reload')
|
||||
if os.environ.get('NO_SERVICE_RESTART'):
|
||||
|
Loading…
Reference in New Issue
Block a user