On (Debian) Linux I want to:
- Execute a command.
- If the command doesn't complete in 10 seconds, kill it and try another command.
The use-case is:
I have a daemon service which I would like to shut down gracefully. It can be stopped by sending a TCP command. If the TCP command does not return, kill the process using Posix HUP.
start-stop-daemon doesn't seem to do this, anyone got any hints ?