mirror of https://github.com/zulip/zulip.git
restore-backup: Reset cwd when switching to postgres user.
Fixes permission errors when running restore-backup from a cwd inaccessible to the postgres user. Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
parent
31cedbc9b8
commit
206741117c
|
@ -84,7 +84,7 @@ if __name__ == "__main__":
|
||||||
"zulip_base",
|
"zulip_base",
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
as_postgres = ["su", "-s", "/usr/bin/env", "--", POSTGRES_USER]
|
as_postgres = ["su", "-s", "/usr/bin/env", "-", "--", POSTGRES_USER]
|
||||||
run(as_postgres + ["dropdb", "--if-exists", "--", db_name])
|
run(as_postgres + ["dropdb", "--if-exists", "--", db_name])
|
||||||
run(as_postgres + ["createdb", "-O", "zulip", "-T", "template0", "--", db_name])
|
run(as_postgres + ["createdb", "-O", "zulip", "-T", "template0", "--", db_name])
|
||||||
run(as_postgres + ["pg_restore", "-d", db_name, "--", db_dir])
|
run(as_postgres + ["pg_restore", "-d", db_name, "--", db_dir])
|
||||||
|
|
Loading…
Reference in New Issue