I don't know of any "right" way to do this. You can create a control with a DS connection, create a property node for it and use the Datasocket>>Status property to check. If it's anything other than Active, close and restart the server (be sure to have a wait before checking again).
___________________
Try to take over the world!