mirror of
https://github.com/zulip/zulip.git
synced 2025-11-14 19:06:09 +00:00
restore-backup: Set the recreated database owner to zulip.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This commit is contained in:
committed by
Tim Abbott
parent
afd06bdb46
commit
6f2903dd29
@@ -82,7 +82,7 @@ if __name__ == "__main__":
|
|||||||
)
|
)
|
||||||
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", "-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])
|
||||||
run(["chown", "-R", str(uid), "--", tmp])
|
run(["chown", "-R", str(uid), "--", tmp])
|
||||||
os.setresuid(uid, uid, 0)
|
os.setresuid(uid, uid, 0)
|
||||||
|
|||||||
Reference in New Issue
Block a user