Skip to content

Instantly share code, notes, and snippets.

@amane-katagiri
Last active August 9, 2017 13:17
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 amane-katagiri/ad5faacf00ad3c5b34c55af2f3a47756 to your computer and use it in GitHub Desktop.
Save amane-katagiri/ad5faacf00ad3c5b34c55af2f3a47756 to your computer and use it in GitHub Desktop.
foregroundize script (useful in docker)
#!/bin/sh
trap 'echo "reload command"' HUP
trap 'echo "stop command"' EXIT
trap 'echo "stop command"; trap EXIT; exit 0' TERM INT
echo "start command which launches a background service and returns immediately"
while true; do sleep 3600 & wait; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment