summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndrew Morgan <1342360+anoadragon453@users.noreply.github.com>2019-11-20 13:32:31 +0000
committerGitHub <noreply@github.com>2019-11-20 13:32:31 +0000
commit234f55f3c4295f08399b725cda8a8aa4b559f1f5 (patch)
tree26e5be6d11f922dd8bb645c30ec2739f07c35251
parentMove admin endpoints into separate files (#6308) (diff)
downloadsynapse-234f55f3c4295f08399b725cda8a8aa4b559f1f5.tar.xz
Docker: Change permissions for data dir before attempting to write to it (#6389)
-rw-r--r--changelog.d/6389.bugfix1
-rwxr-xr-xdocker/start.py6
2 files changed, 4 insertions, 3 deletions
diff --git a/changelog.d/6389.bugfix b/changelog.d/6389.bugfix
new file mode 100644
index 0000000000..c553622b02
--- /dev/null
+++ b/changelog.d/6389.bugfix
@@ -0,0 +1 @@
+Fix permission denied error when trying to generate a config file with the docker image.
\ No newline at end of file
diff --git a/docker/start.py b/docker/start.py
index 6e1cb807a1..97fd247f8f 100755
--- a/docker/start.py
+++ b/docker/start.py
@@ -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)