Skip to content

Instantly share code, notes, and snippets.

@ainsofs
Created November 5, 2024 00:12
Show Gist options
  • Save ainsofs/be272e0433980333e02fe026d6e09794 to your computer and use it in GitHub Desktop.
Save ainsofs/be272e0433980333e02fe026d6e09794 to your computer and use it in GitHub Desktop.
Helper script to restart docker services
#!/bin/bash
# ref https://wodby.com/docs/1.0/infrastructure/disk/#3-moving-docker-and-wodbys-data-to-new-volume
echo "Stopping all Kubernetes components and Docker..."
# Stop all services in parallel
systemctl stop kube-apiserver &
systemctl stop kube-controller &
systemctl stop kube-kubelet &
systemctl stop kube-proxy &
systemctl stop kube-scheduler &
systemctl stop docker &
# Wait for all stops to complete
wait
echo "All services stopped. Beginning startup sequence..."
# Start all services in parallel
systemctl start docker &
systemctl start kube-apiserver &
systemctl start kube-controller &
systemctl start kube-kubelet &
systemctl start kube-proxy &
systemctl start kube-scheduler &
# Wait for all starts to complete
wait
echo "All services have been restarted"
# Verify the status of all services
echo "Verifying service status..."
for service in docker kube-apiserver kube-controller kube-kubelet kube-proxy kube-scheduler; do
systemctl status $service --no-pager | grep Active
done
@ainsofs
Copy link
Author

ainsofs commented Nov 5, 2024

Download to current dir and run it as root

curl -O https://gist.githubusercontent.com/ainsofs/be272e0433980333e02fe026d6e09794/raw/restart_wodby.sh
bash restart_wodby.sh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment