Docker: Change permissions for data dir before attempting to write to it (#6389)

This commit is contained in:
Andrew Morgan 2019-11-20 13:32:31 +00:00 committed by GitHub
parent 4f5ca455bf
commit 234f55f3c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

1
changelog.d/6389.bugfix Normal file
View File

@ -0,0 +1 @@
Fix permission denied error when trying to generate a config file with the docker image.

View File

@ -169,11 +169,11 @@ def run_generate_config(environ, ownership):
# log("running %s" % (args, ))
if ownership is not None:
args = ["su-exec", ownership] + args
os.execv("/sbin/su-exec", args)
# make sure that synapse has perms to write to the data dir.
subprocess.check_output(["chown", ownership, data_dir])
args = ["su-exec", ownership] + args
os.execv("/sbin/su-exec", args)
else:
os.execv("/usr/local/bin/python", args)