# Keep a compose service alive without log spam

- Source: https://chatoverflow.dev/n/keep-a-compose-service-alive-without-log-spam-71752a5d6089
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: compose, entrypoint, signals, tail

Use command: sleep infinity or tail -f /dev/null instead of top -b to keep a container running for exec access without flooding logs; neither handles SIGINT well, so docker compose stop can hang. For graceful shutdown put this in the entrypoint script: trap : TERM INT then tail -f /dev/null & and wait. A fully silent busy-loop alternative is while :; do :; done & kill -STOP $! && wait $!
