Skip to content

Instantly share code, notes, and snippets.

@shesek
Created February 5, 2021 11:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shesek/c8c9c7704ed2a48c76736abefce8ecc0 to your computer and use it in GitHub Desktop.
Save shesek/c8c9c7704ed2a48c76736abefce8ecc0 to your computer and use it in GitHub Desktop.
Display which services are in the process of shutting down (s6)
#!/bin/bash
sp='\|/-'
i=1
cd /var/run/s6/services
while :; do
services=$(for s in *; do s6-svstat $s 2> /dev/null | grep -q 'want down' && echo $s || true; done)
[ -n "$services" ] || break
echo -ne "[s6-finish] waiting for: $services ${sp:i++%${#sp}:1} \r"
sleep 0.2
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment