From 720c1bc0a12f43bc337820b3aa3f3ec586107e9e Mon Sep 17 00:00:00 2001 From: Pratik Vyas Date: Tue, 18 Nov 2014 17:33:36 +0530 Subject: [PATCH] fix fix permissions patch --- bench/cli.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/bench/cli.py b/bench/cli.py index 42b6636b..9dcb8707 100644 --- a/bench/cli.py +++ b/bench/cli.py @@ -388,6 +388,9 @@ def _patch_mariadb_config(): @click.command('fix-perms') def _fix_perms(): + if os.path.exists("config/supervisor.conf"): + exec_cmd("supervisorctl stop frappe:") + "Fix permissions if supervisor processes were run as root" files = [ "logs/web.error.log", @@ -397,7 +400,7 @@ def _fix_perms(): "logs/worker.error.log", "logs/worker.log", "config/nginx.conf", - "logs/supervisor.conf", + "config/supervisor.conf", ] frappe_user = get_config().get('frappe_user') @@ -411,7 +414,10 @@ def _fix_perms(): gid = grp.getgrnam(frappe_user).gr_gid os.chown(path, uid, gid) - exec_cmd("{bench} setup supervisor".format(bench=sys.argv[0])) + if os.path.exists("config/supervisor.conf"): + exec_cmd("{bench} setup supervisor".format(bench=sys.argv[0])) + exec_cmd("supervisorctl reload") + patch.add_command(_patch_mariadb_config) patch.add_command(_fix_perms)