INNER CODE UNIT · Go
registerOnShutdown
deckhouse/deckhouse · dhctl/cmd/dhctl/main.go:290
func registerOnShutdown(title string, action onShutdownFunc) {
tomb.RegisterOnShutdown(title, action)
}
func main() {
appContext := context.Background()
opts := options.New()
initGlobalVars()
registerOnShutdown("Restore terminal if needed", restoreTerminal())
registerOnShutdown("Leave alternate screen if needed", logger.RestoreTerminal)
defer logger.RestoreTerminal()
registerOnShutdown("Stop kubernetes provider daemon", tofu.StopProviderDaemon)
go tomb.WaitForProcessInterruption(tomb.BeforeInterrupted{
disableCleanupOnInterrupted,