discourse: enable restoring backups bigger than RAM
When restoring a backup, discourse decompresses the backup archive in the /share/discourse/tmp dir. Before this change, it is linked to /run which is typically backed by memory, so the backup will fail to restore if you do not have enough memory on your system to contain the backup. This has already happened to me on two small forums. This moves tmp to the StateDirectory /var/lib/discourse/tmp which is typically backed by disk.
This commit is contained in:
@@ -727,6 +727,8 @@ in
|
||||
|
||||
umask u=rwx,g=rx,o=
|
||||
|
||||
rm -rf /var/lib/discourse/tmp/*
|
||||
|
||||
cp -r ${cfg.package}/share/discourse/config.dist/* /run/discourse/config/
|
||||
cp -r ${cfg.package}/share/discourse/public.dist/* /run/discourse/public/
|
||||
ln -sf /var/lib/discourse/uploads /run/discourse/public/uploads
|
||||
@@ -748,7 +750,7 @@ in
|
||||
)
|
||||
|
||||
discourse-rake db:migrate >>/var/log/discourse/db_migration.log
|
||||
chmod -R u+w /run/discourse/tmp/
|
||||
chmod -R u+w /var/lib/discourse/tmp/
|
||||
|
||||
export ADMIN_EMAIL="${cfg.admin.email}"
|
||||
export ADMIN_NAME="${cfg.admin.fullName}"
|
||||
@@ -768,7 +770,6 @@ in
|
||||
RuntimeDirectory = map (p: "discourse/" + p) [
|
||||
"config"
|
||||
"home"
|
||||
"tmp"
|
||||
"assets/javascripts/plugins"
|
||||
"public"
|
||||
"sockets"
|
||||
@@ -777,6 +778,7 @@ in
|
||||
StateDirectory = map (p: "discourse/" + p) [
|
||||
"uploads"
|
||||
"backups"
|
||||
"tmp"
|
||||
];
|
||||
StateDirectoryMode = 0750;
|
||||
LogsDirectory = "discourse";
|
||||
|
||||
Reference in New Issue
Block a user