From 116e41f1daa1817f320a0b6c7c26c650a8650d40 Mon Sep 17 00:00:00 2001 From: Alex Vandiver Date: Tue, 18 May 2021 23:37:18 +0000 Subject: [PATCH] puppet: Move files out and back when mounting /srv. Specifically, this affects /srv/zulip-aws-tools. --- puppet/zulip_ops/files/postgresql/setup_disks.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/puppet/zulip_ops/files/postgresql/setup_disks.sh b/puppet/zulip_ops/files/postgresql/setup_disks.sh index 35a4a1230e..2eb6583856 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