graceful shutdown rpc