Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

puppet: Move files out and back when mounting /srv.

Alex Vandiver116e41f1daa1
diff --git a/puppet/zulip_ops/files/postgresql/setup_disks.sh b/puppet/zulip_ops/files/postgresql/setup_disks.sh
index 35a4a1230ed..2eb6583856e 100755
--- a/puppet/zulip_ops/files/postgresql/setup_disks.sh
+++ b/puppet/zulip_ops/files/postgresql/setup_disks.sh
@@ -13,7 +13,12 @@ fi
if ! mountpoint -q /srv; then
mkfs.xfs "$LOCALDISK"
+ # Move any existing files/directories out of the way
+ TMPDIR=$(mktemp -d)
+ mv /srv/* "$TMPDIR"
mount /srv
+ mv "$TMPDIR/"* /srv
+ rmdir "$TMPDIR"
fi
if [ ! -L /var/lib/postgresql ]; then