Forked from #916.
Now utils.stop_standing_subprocess uses some arguments of ps which is only supported on Linux, but not on Mac OS. So we need to use pgrep instead.
utils.stop_standing_subprocess
ps
pgrep
Also fixed the issue that unit tests did not check status of the subprocesses which should be killed.
This change is