From 05fdd33353d9b536e406b3c39d28678f1994b9b5 Mon Sep 17 00:00:00 2001 From: Simonmicro Date: Thu, 23 Dec 2021 17:53:17 +0100 Subject: [PATCH] Added permission unlocker for log files --- docker/entrypoint.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docker/entrypoint.py b/docker/entrypoint.py index 53f05af..589f13a 100755 --- a/docker/entrypoint.py +++ b/docker/entrypoint.py @@ -41,7 +41,10 @@ def change_uid_grp(): for fName in files: os.chown(os.path.join(root, fName), new_uid, new_gid) loggersrv.debug(str(subprocess.check_output(['ls', '-la', dbPath]))) - + if 'LOGFILE' in os.environ and os.path.exists(os.environ['LOGFILE']): + # Oh, the user also wants a custom log file -> make sure start.py can access it by setting the correct permissions (777) + os.chmod(os.environ['LOGFILE'], 777) + loggersrv.error(str(subprocess.check_output(['ls', '-la', os.environ['LOGFILE']]))) loggersrv.info("Setting gid to '%s'." % str(new_gid)) os.setgid(new_gid)