fix: Improve force removal of existing images in install.sh
- Increase sleep time to 2 seconds - Add SIGKILL as last resort - Continue with warning if removal fails
This commit is contained in:
@@ -92,10 +92,15 @@ for img in $BACKUP workspace; do
|
|||||||
if machinectl list-images | grep -q "^$img"; then
|
if machinectl list-images | grep -q "^$img"; then
|
||||||
echo " Removing existing image: $img"
|
echo " Removing existing image: $img"
|
||||||
machinectl poweroff $img 2>/dev/null || true
|
machinectl poweroff $img 2>/dev/null || true
|
||||||
sleep 1
|
sleep 2
|
||||||
machinectl terminate $img 2>/dev/null || true
|
machinectl terminate $img 2>/dev/null || true
|
||||||
sleep 1
|
sleep 2
|
||||||
machinectl remove $img
|
# Force kill if still running
|
||||||
|
if machinectl status $img &>/dev/null; then
|
||||||
|
machinectl kill $img --signal=SIGKILL 2>/dev/null || true
|
||||||
|
sleep 2
|
||||||
|
fi
|
||||||
|
machinectl remove $img 2>/dev/null || echo " Warning: Could not remove $img (will skip)"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user