Documentation
¶
Overview ¶
Package servicehost defines the native service-manager recovery policy.
Index ¶
- Constants
- func ClearFailures(configPath string) error
- func ConfigureRecovery(string) error
- func FailureCount(configPath string, now time.Time) (int, error)
- func Options() service.KeyValue
- func OptionsFor(goos string) service.KeyValue
- func RecordFailure(configPath string, now time.Time, summary string) error
- func ResetRecovery(name, platform string) error
- func Status(_ string, svc service.Service) (service.Status, error)
- func WindowsRestartDelays() []time.Duration
- type FailureStatus
Constants ¶
View Source
const ( // FailureExitCode signals an unexpected process failure to service managers. FailureExitCode = 1 // FailureWindow bounds the period used to detect a crash loop. FailureWindow = 10 * time.Minute // CrashLoopFailureCount is the first failure count that exhausts recovery. CrashLoopFailureCount = maxFailureExits + 1 )
View Source
const ( // StopTimeout leaves the service manager time to finish process teardown. StopTimeout = 15 * time.Second )
Variables ¶
This section is empty.
Functions ¶
func ClearFailures ¶
ClearFailures resets the crash-loop budget after an intentional stop.
func ConfigureRecovery ¶
ConfigureRecovery is encoded in the installed systemd unit.
func FailureCount ¶
FailureCount returns fatal runs still inside the recovery window.
func OptionsFor ¶
OptionsFor returns the native recovery configuration for goos.
func RecordFailure ¶
RecordFailure persists a fatal run for doctor diagnostics.
func ResetRecovery ¶
ResetRecovery clears systemd's failed state and start-rate counter.
func WindowsRestartDelays ¶
WindowsRestartDelays returns the finite SCM recovery schedule.
Types ¶
type FailureStatus ¶
FailureStatus describes recent service recovery activity.
func ReadFailureStatus ¶
func ReadFailureStatus(configPath string, now time.Time) (FailureStatus, error)
ReadFailureStatus returns recent retry count and the sanitized last failure.
Click to show internal directories.
Click to hide internal directories.