Well, it's nice you ask. I have a specific module in use, that might interest some people.
`check_process' was written as a complement to the service module, when handling Java based services.
These are pretty much known for often bad behaviour, be it because of badly written init scripts, or just because a Java process can take time to clean up itself and shut down.
This module allows to e.g.
- check if a process is running
- check if a process is not running
- check if that process has exactly one process running (restarting a Java service might sometimes keep the old process around, then starting a new, second one...)
- make those checks within a given time-out
- optionally kill the process if it should not be running
- kill the process using several different kill signals, serially and each with its own time-out are possible
I sometimes wondered if this should be up streamed, but always thought it was a more of work-around, and by principle a bit of a hack.
If fellow users think otherwise, I'm willing to consider a PR.
Greetz,
Serge