From 4e48caf240df72ba457e01597671520096788204 Mon Sep 17 00:00:00 2001 From: Reinaldy Rafli Date: Tue, 14 Oct 2025 22:07:15 +0700 Subject: [PATCH 1/2] fix: Move files to correct `/data` directory if any volume-related data exists in `/tmp` for SeaweedFS This is a followup for https://github.com/getsentry/self-hosted/pull/3991 and an alternative of https://github.com/getsentry/self-hosted/pull/3999 that doesn't use a lock file. --- install/turn-things-off.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/install/turn-things-off.sh b/install/turn-things-off.sh index fc0ddf38d48..01f809d524c 100644 --- a/install/turn-things-off.sh +++ b/install/turn-things-off.sh @@ -1,5 +1,21 @@ echo "${_group}Turning things off ..." +# Only execute this when `seaweedfs` container is running +if ! $dc ps --quiet seaweedfs; then + echo "SeaweedFS container is not running, skipping moving tmp data." +else + # Only execute this when we find `*.dat` and/or `*.vif` files in `/tmp` + if [ -n "$($dc exec seaweedfs find /tmp -maxdepth 1 \( -name "*.dat" -o -name "*.vif" \))" ]; then + echo "Moving SeaweedFS tmp data to persistent storage..." + + $dc exec seaweedfs find /tmp -maxdepth 1 \( -name "*.dat" -o -name "*.vif" \) -exec mv -v {} /data/ \; + $dc exec seaweedfs sh -c '[ -d /tmp/m9333 ] && mv -v /tmp/m9333 /data/ || true' + $dc exec seaweedfs sh -c '[ -f /tmp/vol_dir.uuid ] && mv -v /tmp/vol_dir.uuid /data/ || true' + + echo "Moved SeaweedFS tmp data to persistent storage." + fi +fi + if [[ -n "$MINIMIZE_DOWNTIME" ]]; then # Stop everything but relay and nginx $dc rm -fsv $($dc config --services | grep -v -E '^(nginx|relay)$') From 9c5e5d84749e94867b14326148afbf88614ee3f1 Mon Sep 17 00:00:00 2001 From: Reinaldy Rafli Date: Wed, 15 Oct 2025 15:10:01 +0700 Subject: [PATCH 2/2] fix: all hail Seer --- install/turn-things-off.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install/turn-things-off.sh b/install/turn-things-off.sh index 01f809d524c..8c081b10882 100644 --- a/install/turn-things-off.sh +++ b/install/turn-things-off.sh @@ -1,7 +1,7 @@ echo "${_group}Turning things off ..." # Only execute this when `seaweedfs` container is running -if ! $dc ps --quiet seaweedfs; then +if [ -z "$($dc ps --quiet seaweedfs)" ]; then echo "SeaweedFS container is not running, skipping moving tmp data." else # Only execute this when we find `*.dat` and/or `*.vif` files in `/tmp`