Skip to content

Instantly share code, notes, and snippets.

@shesek
Created February 5, 2021 11:11
Embed
What would you like to do?
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