Use panic(restart_object) to signal the desire to shut down MAMID inplace (i.e. close all DB connections, stop Monitoring & Deployment, ...) and then start again.
One could imagine functions as attributes on the restart_object that should be run while the other services...