Be able to add a pre-shutdown hook which could run a script / poll a route to determine if the background service is ready to shut down. Failing that, a configurable shutdown timeout that is longer than the current default.