Add support for restart in ShutdownHook