Skip to content

Commit

Permalink
remove external reboot mode
Browse files Browse the repository at this point in the history
  • Loading branch information
anpep committed Sep 10, 2024
1 parent 96dde03 commit 371e0a2
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions internals/daemon/daemon.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ var (
ErrRestartSocket = fmt.Errorf("daemon stop requested to wait for socket activation")
ErrRestartServiceFailure = fmt.Errorf("daemon stop requested due to service failure")
ErrRestartCheckFailure = fmt.Errorf("daemon stop requested due to check failure")
ErrRestartExternal = fmt.Errorf("daemon stop requested due to reboot handled externally")

systemdSdNotify = systemd.SdNotify
sysGetuid = sys.Getuid
Expand Down Expand Up @@ -712,8 +711,6 @@ const (
SystemdMode RebootMode = iota + 1
// Reboot uses direct kernel syscalls
SyscallMode
// Reboot is handled externally after the daemon stops
ExternalMode
)

// SetRebootMode configures how the system issues a reboot. The default
Expand All @@ -725,8 +722,6 @@ func SetRebootMode(mode RebootMode) {
rebootHandler = systemdModeReboot
case SyscallMode:
rebootHandler = syscallModeReboot
case ExternalMode:
rebootHandler = externalModeReboot
default:
panic(fmt.Sprintf("unsupported reboot mode %v", mode))
}
Expand Down Expand Up @@ -778,13 +773,6 @@ func syscallModeReboot(rebootDelay time.Duration) error {
return nil
}

func externalModeReboot(rebootDelay time.Duration) error {
if rebootDelay > 0 {
time.Sleep(rebootDelay)
}
return ErrRestartExternal
}

func (d *Daemon) Dying() <-chan struct{} {
return d.tomb.Dying()
}
Expand Down

0 comments on commit 371e0a2

Please sign in to comment.