Skip to content

Instantly share code, notes, and snippets.

@lierdakil
Last active September 24, 2023 16:45
Show Gist options
  • Save lierdakil/08d9171abf6133db0411e6f464fc0484 to your computer and use it in GitHub Desktop.
Save lierdakil/08d9171abf6133db0411e6f464fc0484 to your computer and use it in GitHub Desktop.
#!/bin/bash
trap "exit" INT TERM
trap "kill 0" EXIT
unshare -U bash -c 'kill -STOP $$; exec /opt/muse-hub/Muse.Service' &
pid=$!
while ! ( grep '^State:' /proc/$pid/status | grep -q $'\tT ' ); do
sleep 0.1s
done
echo "0 $UID 1" > /proc/$pid/uid_map
kill -CONT $pid
wait
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment