I have a long running process in a docker container that is setup like this:
Dockerfile
...
ENTRYPOINT ["./invoke.sh"]
invoke.sh
#!/bin/bash
./long-running-command
If long-running-command is running properly, it will send output to STDERR every few seconds. If it hangs, it will stop outputting to STDERR. How can I use a monitor or parent process to auto-detect when long-running-command has stopped writing data for a period of time (about 2 minutes) and auto-kill long-running-command?