My integration tests in Maven require to start some external processes (servers). If the user aborts the maven process, those processes continue to linger around. I used to add a 'key' (ie. BUILD_ARTIFACT_PROCID=xyz) to the environment of those processes so I could identify them via a BASH script, relying on cygwin on Windows systems.
However, some servers spawn their own childs not propagating the environment variables or their processes not registering under cygwin's /proc.
This general problem now persists for decades and there seems to be still no cross-platform solution to it.
Anyone able to give me a working, proper solution, ie one that does not rely on potentially stale PID files, that also might be useless if an intermediary process is missing? How do you guys solve that problem?