refactor: cleanup Corrosion container on reset, move admin socket to runtime dir

This commit is contained in:
Pasha Sviderski
2026-05-25 21:41:35 +10:00
parent 71da32549a
commit 442b5c62bf
5 changed files with 87 additions and 22 deletions
+15
View File
@@ -57,6 +57,7 @@ fi
log "⏳ Stopping systemd services..."
systemctl stop uncloud.service || log "uncloud.service not running or doesn't exist."
# TODO: remove uncloud-corrosion.service handling in 0.22 once pre-0.20 systemd installs are gone.
systemctl stop uncloud-corrosion.service || log "uncloud-corrosion.service not running or doesn't exist."
systemctl disable uncloud.service || log "uncloud.service already disabled or doesn't exist."
systemctl disable uncloud-corrosion.service || log "uncloud-corrosion.service already disabled or doesn't exist."
@@ -64,15 +65,29 @@ log "✓ Systemd services stopped."
log "⏳ Removing systemd service files..."
rm -fv "${INSTALL_SYSTEMD_DIR}/uncloud.service"
# TODO: remove uncloud-corrosion.service handling in 0.22 once pre-0.20 systemd installs are gone.
rm -fv "${INSTALL_SYSTEMD_DIR}/uncloud-corrosion.service"
systemctl daemon-reload
log "✓ Systemd service files removed."
log "⏳ Removing binaries..."
rm -fv "${INSTALL_BIN_DIR}/uncloudd"
# TODO: remove uncloud-corrosion binary handling in 0.22 once pre-0.20 systemd installs are gone.
rm -fv "${INSTALL_BIN_DIR}/uncloud-corrosion"
log "✓ Binaries removed."
log "⏳ Removing uncloudd-managed corrosion Docker container..."
if command -v docker &> /dev/null; then
if docker inspect uncloud-corrosion &> /dev/null; then
docker rm -fv uncloud-corrosion || log "Failed to remove uncloud-corrosion container."
log "✓ uncloud-corrosion container removed."
else
log "uncloud-corrosion container not found."
fi
else
log "Docker CLI not found, skipping uncloud-corrosion container cleanup."
fi
log "⏳ Removing data and run directories..."
rm -rfv "${UNCLOUD_DATA_DIR}"
rm -rfv "${UNCLOUD_RUN_DIR}"