Use while loop in startup script to speed up stops/restarts
Instead of sleeping for a long fixed period after sending the
TERM signal, use a while loop containing a short sleep and
a check on process existence.