Don't call the backend if it's not online.
Add frontend alive check to the backend.

Stop the backend if the frontend process does not exist any more and
backend is not a daemon.