Add automatic shutdown code to management daemon.