osrun

package
v0.4.87 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2026 License: Apache-2.0 Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package osrun is what the dashboard knows of an operating system upgrade that runs in a unit of its own: the words it and the unit use (phases, blocks, classes, states, markers), the reader of the unit's log, and the pure reducer that turns that log, a few files of the run and what systemd says into the state of the run and into the one thing to do next.

Nothing here touches the machine: no clock, no file, no systemd, no network. The core reads the box and calls in; the unit (a shell driver the core writes) only ever appends marker lines. The package imports the standard library and nothing of the rest of the core, so that the upgrade's unit and its alerts agree on one vocabulary.

Index

Constants

View Source
const (
	// DoNone is waiting.
	DoNone = "none"
	// DoUnwind starts the unit that puts back what a run that did not pass its point of no return had changed.
	DoUnwind = "unwind"
	// DoLaunchVerify starts the check of the machine after its restart, or again.
	DoLaunchVerify = "launch_verify"
	// DoLaunchRecover starts the repair of a hop that stopped after its point of no return.
	DoLaunchRecover = "launch_recover"
	// DoJudge compares the machine with what it was before the hop.
	DoJudge = "judge"
	// DoBarrier computes the checks that stand between the hop and the restart again.
	DoBarrier = "barrier"
	// DoRemind speaks again of a machine that waits for its restart; Action.N is which reminder.
	DoRemind = "remind"
	// DoCleanup is a run that was closed: its folder can go when there are too many of them.
	DoCleanup = "cleanup"
	// DoAlert tells the owner that a run waits for them. It comes for as long as the run does, the hub that sends it
	// says it once.
	DoAlert = "alert"
)

What the core does next about a run, one thing at a time (Action.Kind).

View Source
const (
	MkQueued          = "QUEUED"
	MkRun             = "RUN"
	MkAttempt         = "ATTEMPT"
	MkStartFailed     = "START_FAILED"
	MkRebootRequested = "REBOOT_REQUESTED"
	MkRebootFailed    = "REBOOT_FAILED"
	MkTakeover        = "TAKEOVER"
	MkAck             = "ACK"
	MkBootSeen        = "BOOT_SEEN"
	MkUnitStart       = "UNIT_START"
	MkBlockStart      = "BLOCK_START"
	MkBlockDone       = "BLOCK_DONE"
	MkBlockSkipped    = "BLOCK_SKIPPED"
	MkStop            = "STOP"
	MkUnwound         = "UNWOUND"
	MkRefreshDone     = "REFRESH_DONE"
	MkRehearsalReady  = "REHEARSAL_READY"
	MkRebootPending   = "REBOOT_PENDING"
	MkRebootNotNeeded = "REBOOT_NOT_NEEDED"
	MkVerifyDone      = "VERIFY_DONE"
	MkUnitEnd         = "UNIT_END"
)

The kinds of marker. The core writes the first nine, the unit's driver the others.

View Source
const (
	// PhaseRefresh brings the current release to its latest state (no point of no return).
	PhaseRefresh = "refresh"
	// PhaseRehearse runs the reversible half of a hop and stops, with the new release's sources in place.
	PhaseRehearse = "rehearse"
	// PhaseRun is the hop itself, up to the point where the machine has to restart.
	PhaseRun = "run"
	// PhaseRecover finishes a hop that stopped after its point of no return.
	PhaseRecover = "recover"
	// PhaseVerify is the check of the machine after the restart.
	PhaseVerify = "verify"
	// PhaseUnwind puts back what a run that stopped before its point of no return had changed.
	PhaseUnwind = "unwind"
)

What a unit does, in the order a hop goes through them (Attempt.Phase, the PHASE of the unit's environment).

View Source
const (
	RunRefresh   = "refresh"
	RunHop       = "hop"
	RunRehearsal = "rehearsal"
)

What a run is for (the kind on its RUN marker).

View Source
const (
	BlockVerify    = "verify"
	BlockTimers    = "timers"
	BlockSnapshot  = "snapshot"
	BlockSources   = "sources"
	BlockDownload  = "download"
	BlockMinimal   = "minimal"
	BlockFull      = "full"
	BlockPrereboot = "prereboot"
	BlockAfter     = "after"
	BlockForward   = "forward"
	BlockRCheck    = "rcheck"
	BlockRSources  = "rsources"
	BlockRUpgrade  = "rupgrade"
	BlockRDone     = "rdone"
)

The blocks a driver can run: the nine blocks of the hop, the block that repairs a hop that stopped after its point of no return, and the four blocks of a refresh.

View Source
const (
	StopDriver = "driver"
	StopList   = "list"
	StopUnwind = "unwind"
)

The ids a STOP marker can carry that are not a block's: the driver's own checks, a list it cannot read, and the unwind.

View Source
const (
	ClassBusy            = "busy"
	ClassNetwork         = "network"
	ClassAptFailed       = "apt_failed"
	ClassDpkgBroken      = "dpkg_broken"
	ClassUnknown         = "unknown"
	ClassDisk            = "disk"
	ClassPlan            = "plan"
	ClassGuard           = "guard"
	ClassConverge        = "converge"
	ClassBarrierKernel   = "barrier_kernel"
	ClassBarrierInitrd   = "barrier_initrd"
	ClassBarrierGrub     = "barrier_grub"
	ClassBarrierSSHD     = "barrier_sshd"
	ClassBarrierResolver = "barrier_resolver"
	ClassBarrierOther    = "barrier_other"
	ClassIdentity        = "identity"
	ClassTools           = "tools"
	ClassUnit            = "unit"
	ClassIntegrity       = "integrity"
	ClassAbort           = "abort"
)

How a block that stopped is told (STOP's class, State.Class and the reason of a failed run). The page has a sentence for each.

View Source
const (
	StateIdle                  = "idle"
	StateRefreshing            = "refreshing"
	StateRebootFirst           = "reboot_first"
	StateRefreshed             = "refreshed"
	StateRehearsing            = "rehearsing"
	StateRehearsed             = "rehearsed"
	StateRehearsalDone         = "rehearsal_done"
	StateRunning               = "running"
	StateUnwinding             = "unwinding"
	StateRecovering            = "recovering"
	StateAwaitingReboot        = "awaiting_reboot"
	StateRebooting             = "rebooting"
	StateRebootStalled         = "reboot_stalled"
	StateResuming              = "resuming"
	StateVerifying             = "verifying"
	StateSucceeded             = "succeeded"
	StateSucceededWithFindings = "succeeded_with_findings"
	StateFailed                = "failed"
	StateInterrupted           = "interrupted"
	StateStoppedAtWaypoint     = "stopped_at_waypoint"
	StateNeedsAttention        = "needs_attention"
	StateManual                = "manual"
	StateManualDone            = "manual_done"
)

The states of a run (State.Name).

View Source
const (
	ReasonStart             = "start"
	ReasonVerify            = "verify"
	ReasonHalf              = "half"
	ReasonInterruptedPower  = "interrupted_power"
	ReasonInterruptedKilled = "interrupted_killed"
)

Why a failed run failed, besides a class: what the run was doing when the machine or the unit gave out, and the checks after the restart (State.Reason of a failed state).

View Source
const (
	ReasonSystemdSilent = "systemd_silent"
	ReasonUnwindPartial = "unwind_partial"
	ReasonRunDamaged    = "run_damaged"
)

Why a run needs attention (State.Reason of a needs_attention state).

View Source
const (
	CausePower  = "power"
	CauseKilled = "killed"
)

How a run was interrupted (State.Cause).

View Source
const (
	ActionAbort       = "abort"
	ActionReboot      = "reboot"
	ActionResume      = "resume"
	ActionAcknowledge = "acknowledge"
	ActionDiscard     = "discard"
	ActionTakeover    = "takeover"
)

The buttons the server can offer, in the order it lists them (ActionsFor).

View Source
const (
	WhoAuto  = "auto"
	WhoOwner = "owner"
)

Who launched an attempt (ATTEMPT's who).

View Source
const AckWord = "I-KNOW-THIS-MACHINE-IS-HALF-UPGRADED"

AckWord is what the owner types to close a machine that is half upgraded: closing the run drops the flag that keeps backups and automatic updates away from a machine that dpkg has begun to change.

View Source
const Driver = `` /* 7248-byte string literal not displayed */

Driver is the shell that the unit of an upgrade runs: it takes the blocks that the core listed for ONE attempt and runs them one by one, writes one marker line for each thing that happens, undoes what the blocks changed while the point of no return is not behind it, and never restarts the machine. The unit starts it as /bin/sh <run folder>/driver.sh, with the nonce, the folder, the phase, the attempt and the run in its environment.

The text is constant: nothing of the machine is written into it. What it needs is in the environment of the unit, or in files of the run's folder that SHA256SUMS covers (the list of the blocks of an attempt is the one file that is not in it: every id in a list is checked against the closed set that the text holds). It is a raw string, and not a file that is embedded, because a checkout that turns line ends into CR LF breaks a shell, and the compiler takes the carriage returns out of a raw string.

What it must keep: no pipeline (a reader that leaves early kills the writer with status 141), no trap (a stop kills the unit, and the core reads a lost unit from the files), no command that restarts the machine, no job control, no tracing (block 3 holds the owner's sources, credentials included), the standard input of every child is /dev/null, the nonce is in no child's environment, every marker is one printf, and the exit status is 0 whatever happened (the markers say what happened), but for a log of the run that cannot be opened for appending: that is 2, and nothing has been done. The tests of the text are here (driver_test.go: the golden, these properties, the closed sets), and the tests that run it are in pkg/osplan (driver_*_test.go), beside the blocks that it runs.

View Source
const HintReleaseInfoChange = "releaseinfo_change"

HintReleaseInfoChange is the hint for a repository whose release information changed.

View Source
const HintSecurityArchiveGap = "security_archive_gap"

HintSecurityArchiveGap is the hint for a refresh whose download got 404 from security.debian.org: the security mirror of Debian 11 lists files that now live on archive.debian.org, and a line of the sources that the refresh did not recognise still points at it.

Variables

ActionNames are the buttons, in the order ActionsFor lists them.

BlockIDs are the blocks a driver can run; the driver's own list of them is the same set.

Classes are the classes of a stop. Every one is lower case letters and underscores, which is what the driver lets through from a block's own word.

View Source
var DefaultTiming = Timing{
	GraceQuiet:        30 * time.Second,
	StartLost:         30 * time.Second,
	StartLostSilent:   30 * time.Minute,
	SystemdSilence:    30 * time.Minute,
	RebootStall:       15 * time.Minute,
	RehearsalTTL:      30 * time.Minute,
	ResumeWait:        10 * time.Minute,
	SettleEvery:       30 * time.Second,
	MaxVerifyAttempts: 3,
	MaxUnwindAttempts: 3,
	AutoRecoverTries:  0,
	AutoRecoverWave:   1,
	Backoff:           [2]time.Duration{2 * time.Minute, 10 * time.Minute},
	Reminders:         [3]time.Duration{time.Hour, 24 * time.Hour, 24 * time.Hour},
	HungQuiet:         30 * time.Minute,
	FactCommand:       20 * time.Second,
	ContainersWait:    5 * time.Minute,
	MarkersMax:        markersMax,
	MarkerLineMax:     markerLineMax,
	LogTail:           128 << 10,
}

DefaultTiming is what the core runs with. Tests take a copy and change it.

View Source
var ErrMarkersTooLarge = errors.New("the log of the upgrade is longer than it can be")

ErrMarkersTooLarge is what ParseMarkers answers, with what it read, when the file is longer than it reads: a run's story is a few kilobytes, and one that is not is not to be trusted to say how it ended. A caller that gets it reduces what it was given with Input.Damaged set.

MarkerKinds are the kinds of marker.

Phases are the phases a unit can be started with.

RunKinds are the kinds of run.

States are the states of a run.

Functions

func ActionsFor

func ActionsFor(s State) []string

ActionsFor is the buttons that are valid for a state now, in the order of ActionNames. The server decides, and the page shows exactly these; whether the feature is switched on does not change them. A button that the state alone cannot decide (dropping a plan that is still alive) is left to the caller to take away.

func BlockList

func BlockList(phase string, f Files) []string

BlockList is what a driver is asked to run for a phase, from the files of the run: the blocks, in order, as the driver takes them (a block that already has its done file is skipped by the driver, not left out here, except for recover). For a repair it is the repair block (when the first block of the hop that is not done is the minimal or the full upgrade: the machine may be half way through dpkg) and then that block and the ones after it, up to the last one before the restart; nothing when they are all done. The unwind is run with no block at all.

func BootKnown

func BootKnown(ms []Marker, boot string) bool

BootKnown is whether the log has already told of a boot: the one the run began in, or one that the core saw afterwards and wrote down. A boot that is neither is new to the run, and the core notes it once.

func FirstMissing

func FirstMissing(f Files) string

FirstMissing is the first block among the minimal upgrade, the full upgrade and the last block before the restart that has no done file, "" when all three have one.

func FormatTime

func FormatTime(t time.Time) string

FormatTime is how a marker writes a time.

func HintOf

func HintOf(detailLine string) string

HintOf is a word for what the owner can do about the line that explains a failure, "" when there is none. The one there is: apt refused to take a repository whose release information changed, and the owner can say the change is wanted. It is read from apt's fixed English text.

func NextAttempt

func NextAttempt(in Input) int

NextAttempt is the number the next attempt of the run takes: one more than the attempts that the reducer counts.

func Retryable

func Retryable(class string, wave int) bool

Retryable is whether the core may repair a stop of this class by itself, in a wave of repairs: wave 1 has the classes that are about the world being busy or away, wave 2 adds the ones that are about the packages, and no wave has the others.

func ValidBlock

func ValidBlock(s string) bool

ValidBlock reports whether s is the id of a block.

func ValidClass

func ValidClass(s string) bool

ValidClass reports whether s is a class of stop.

func ValidNonce

func ValidNonce(s string) bool

ValidNonce reports whether s is 32 lower case hex digits, what the core makes the nonce of a run of.

func ValidPhase

func ValidPhase(s string) bool

ValidPhase reports whether s is a phase.

func ValidUUID

func ValidUUID(s string) bool

ValidUUID reports whether s is a lower case UUID, the shape of a run's id and of the kernel's boot ids.

Types

type Action

type Action struct {
	Kind, Phase, From, Who string
	N                      int
}

An Action is the one thing to do next. Phase is the phase of the attempt to launch, From the block it is to begin with (a repair), Who is who asked for it, and N is which reminder is due.

func NextAction

func NextAction(s State, in Input) Action

NextAction is the one thing to do about a run now, from its state and the input it was reduced from. It never starts a unit while systemd does not answer, while one is running or on its way, after the owner took over or closed the run, nor for an attempt number that has been launched.

type Attempt

type Attempt struct {
	RunID string
	Nonce string
	Phase string
	// N is the number of the attempt, from 1 to 999.
	N int
}

An Attempt is one launch of the unit: what the core needs to say to start it. The nonce is only ever in the unit's own environment.

func (Attempt) Validate

func (a Attempt) Validate() error

Validate says whether every part of the attempt is of the shape a unit is started with.

type Barrier

type Barrier struct {
	OK     bool
	Checks []BarrierCheck
}

Barrier is the answer of the checks that run while the machine waits for its restart.

type BarrierCheck

type BarrierCheck struct {
	Code     string
	OK       bool
	Severity string
}

A BarrierCheck is one of the read-only checks that stand between a finished hop and the restart.

type Behavior

type Behavior struct {
	// Resumable is whether the owner can ask for the run to go on from a stop of this class after the point of no return.
	// Before the point of no return every class is undone, and there is nothing to resume.
	Resumable bool
	// Wave is the first wave of automatic repairs that may repair a stop of this class by itself: 1 or 2, and 0 for a class
	// that is never repaired without the owner.
	Wave int
}

Behavior is what a class of stop means for a run.

func ClassBehavior

func ClassBehavior(class string) Behavior

ClassBehavior is what a class of stop means after the point of no return. A class that is not one of Classes is not resumable and never automatic: only the owner can say what to do with a machine in a state nobody foresaw.

type BlockRef

type BlockRef struct {
	Index int
	ID    string
}

BlockRef is a block of an attempt's list: its place in it, from 1, and which one it is. The zero value is none.

type Boot

type Boot struct {
	Now string
	OK  bool
}

Boot is the id of the boot the machine is in now; OK is false when it could not be read.

type Files

type Files struct {
	// Begun is the marker file that the minimal upgrade's block writes just before apt is let to change a package;
	// DoneMinimal, DoneFull, DonePrereboot and DoneAfter are the files the blocks of the same name end with.
	Begun, DoneMinimal, DoneFull, DonePrereboot, DoneAfter bool
	// DoneTimers says that the block that stops the timers of apt has ended; AptOrig that the copy of the box's sources
	// is in the backup folder; AbortFlag that the core has written the owner's call to stop.
	DoneTimers, AptOrig, AbortFlag bool
	// BootIDFile is the first line of the backup folder's boot_id file, the id of the boot that the last block of the hop
	// ran in: "" when there is none, which is also how a restart that already happened shows.
	BootIDFile string
}

Files is the part of the run's folder and of the backup folder that the reducer reads. The point of no return is read from these files and never from a marker: a unit that died before it wrote its marker is still classified right.

func (Files) PNR

func (f Files) PNR() bool

PNR is the point of no return: packages are being or have been changed, and the old release can no longer be put back.

type Input

type Input struct {
	// Markers are the valid lines of the log, in order, as ParseMarkers gives them (the QUEUED line first); Ignored is
	// how many lines it did not take, which the status shows and the reducer does not use.
	Markers []Marker
	Ignored int
	Files   Files
	Unit    Unit
	Boot    Boot
	// Now is the time of the reading; LastActivity is the later of the last marker's time and the unit's output file's: a
	// time that is after Now counts as Now, except as the proof that a unit that is gone has just spoken (see spokeLately), and a missing one
	// is made up from the markers.
	Now, LastActivity time.Time
	// Barrier is nil until it has been computed; Verify is nil until the judge has run.
	Barrier *Barrier
	Verify  *VerifyResult
	// Ready is the core's reading of the machine that has just restarted (the system is running or degraded, without
	// waiting for it to be); BootSeenAt is when the core noted the new boot.
	Ready      bool
	BootSeenAt time.Time
	// Reminded is how many reminders of a machine that waits for its restart have been sent, from the core's own record.
	Reminded int
	// Damaged says that the run cannot be trusted, which the log does not say: the files of the run are not the ones the
	// core wrote, or the log is longer than it can be read.
	Damaged bool
	// Timing is DefaultTiming, or what a test sets. The zero value is taken for DefaultTiming.
	Timing Timing
}

Input is everything the reducer reads. It is all data: the reducer has no clock, opens no file and asks no one.

type Marker

type Marker struct {
	Kind string
	// N is the attempt the marker belongs to, 0 for the markers of the run.
	N int
	// At is the time the marker says, zero for the kinds that carry none.
	At time.Time

	// RUN
	RunID, Hop, PlanID, RunKind string
	// ATTEMPT (Phase, From: the block the attempt is meant to start at, Who: auto or owner) and UNIT_START (Phase)
	Phase, From, Who string
	// RUN, BOOT_SEEN, UNIT_START, REBOOT_PENDING and VERIFY_DONE: the id of a boot
	Boot string
	// UNIT_START: the driver's process id
	PID int
	// BLOCK_START, BLOCK_DONE, BLOCK_SKIPPED and STOP: the place of the block in the attempt's list, and which one it is
	// (one of BlockIDs, or for a STOP also StopDriver, StopList or StopUnwind)
	Index int
	ID    string
	// STOP: the status of the block, how it is told (always one of Classes: a word that is not one is unknown), and whether
	// the driver thought the point of no return had been passed
	RC    int
	Class string
	PNR   bool
	// ACK (discard, acknowledge), UNWOUND (ok, partial), REFRESH_DONE (yes, no) and UNIT_END (ok, stopped)
	Result string
	// REFRESH_DONE: why a restart is wanted, REBOOT_PENDING and REBOOT_NOT_NEEDED: the kernel
	Why, Kernel string
}

A Marker is one valid line of the log. Only the fields its Kind has are set; the others are empty. A field that the line writes as "-" (a boot id, a plan id or a block that is not known) is the empty string here.

func ParseMarkers

func ParseMarkers(r io.Reader) (nonce string, ms []Marker, ignored int, err error)

ParseMarkers reads the log of a run. The nonce is the one on the first line, which must be the core's QUEUED marker; with no such line there is no run, and the answer is empty. After that a line is a marker only if it has the exact shape of one with that nonce: anything else (apt's words, a forged nonce, a carriage return, a NUL, a line that is too long or not whole, an empty one) is counted and left out. The markers are in the order of the file, the QUEUED one first. At most 1 MiB is read; a longer file gives ErrMarkersTooLarge with what was before the limit. It never panics on any bytes.

func (Marker) Line

func (m Marker) Line(nonce string) (string, error)

Line is the marker as the core writes it to the log, with its newline. It fails for a marker that no reader would take: a kind that is not one, fields that are not valid, a line that is too long.

type State

type State struct {
	Name string
	// Reason is why a failed run failed (a class, or one of the Reason constants) or why a run needs attention; Cause is
	// how an interrupted run was interrupted; Class is the class of the stop behind a failed or stopped state.
	Reason, Cause, Class string
	// Phase and Attempt are the phase and the number of the latest attempt, Block the block it is in (for a running state)
	// or the block that stopped (for a stopped one), and RC the status that block ended with.
	Phase   string
	Attempt int
	Block   BlockRef
	RC      int
	// Kind, RunID, Hop and PlanID are the run's own, from its RUN marker.
	Kind, RunID, Hop, PlanID string
	// PNR is whether packages are being or have been changed; Reversible is the same thing the other way round.
	PNR, Reversible bool
	// Busy is whether the machine must be left alone: backups and automatic updates stay away, and so does the owner.
	Busy bool
	// HalfUpgraded is whether the point of no return is behind and the last block before the restart did not end.
	HalfUpgraded bool
	// Resumable is whether the owner can ask for the run to go on.
	Resumable bool
	// Abortable is whether the owner can still call the run off by stopping its unit.
	Abortable bool
	// RebootBlocked is whether the restart must not be offered: the checks that come before it are not computed or not green.
	RebootBlocked bool
	// BootUnknown is whether the boot id could not be read where it was needed, so that nothing was inferred from it;
	// Stalled is whether a restart that was asked for did not happen in time.
	BootUnknown, Stalled bool
	// Closed is whether the owner has closed the run.
	Closed bool
	// Since is when the run came to this state, as far as the log and the files say; ExpiresAt is when a rehearsal is undone.
	Since     time.Time
	ExpiresAt *time.Time
}

State is where a run is. Name is one of States; the other strings are set only where the state has them.

func Reduce

func Reduce(in Input) State

Reduce is the state of a run, from what the log and the files of the run say and what systemd and the kernel say now. It is a function of its input and of nothing else.

func (State) NeedsAckWord

func (s State) NeedsAckWord() bool

NeedsAckWord is whether closing the run takes the typed word: a machine that is half upgraded, one that needs attention, and one that the owner took over and did not finish (a run taken over from needs_attention is the same machine, with the same sources of the next release perhaps in place and the same packages perhaps half configured, and the click that takes it over must not be a way round the word), whether or not the point of no return was passed: closing the run drops the flag that keeps backups and automatic updates away from it.

type Timing

type Timing struct {
	// GraceQuiet is how long a unit that systemd calls gone may still be quiet before the run is called interrupted:
	// systemd can say "gone" before the last line of the unit lands.
	GraceQuiet time.Duration
	// StartLost is how long an attempt with no word from its unit is waited for when systemd says the unit is not there;
	// StartLostSilent is the same when systemd does not answer.
	StartLost, StartLostSilent time.Duration
	// SystemdSilence is how long a unit that has not ended and a systemd that does not answer are waited for, as long as
	// the unit shows signs of life, before the run needs attention.
	SystemdSilence time.Duration
	// RebootStall is how long a restart that was asked for is waited for before it is called stalled.
	RebootStall time.Duration
	// RehearsalTTL is how long the machine is left with the next release's sources in place after a rehearsal.
	RehearsalTTL time.Duration
	// ResumeWait is how long a machine that has restarted is given to get ready before the check starts anyway.
	ResumeWait time.Duration
	// SettleEvery is how often the core looks at a run that is open.
	SettleEvery time.Duration
	// MaxVerifyAttempts and MaxUnwindAttempts bound how many times the check after the restart, and the undoing of a run
	// that stopped before the point of no return, are started again by themselves.
	MaxVerifyAttempts, MaxUnwindAttempts int
	// AutoRecoverTries is how many times the core may repair a hop that stopped after its point of no return, by itself,
	// before it leaves it to the owner; AutoRecoverWave is which classes of stop it may do that for (see Retryable).
	// With zero tries nothing is ever repaired without a click: the repair ladder has not run on a real machine yet.
	AutoRecoverTries, AutoRecoverWave int
	// Backoff is how long the core waits after a stop before its first and its second automatic repair; the last one
	// counts for every one after.
	Backoff [2]time.Duration
	// Reminders are when a machine that waits for its restart is spoken of again, counted from when it began to wait:
	// the first, the second, and then every third interval.
	Reminders [3]time.Duration
	// HungQuiet is how long a unit that systemd says runs may print nothing before the status says that it may be stuck, and what
	// the owner can do at the console about it.
	HungQuiet time.Duration
	// FactCommand is how long each question that the judge puts to the machine has, so that one that hangs cannot take the time of
	// the ones after it; ContainersWait is how long after the check a container that has a restart policy and is not running yet is
	// waited for before it is said not to have come back.
	FactCommand, ContainersWait time.Duration
	// MarkersMax is how much of the log of markers is read, MarkerLineMax how long a line of it may be (without its
	// newline), and LogTail how much of the unit's output the status shows.
	MarkersMax, MarkerLineMax, LogTail int
}

Timing holds every number that the reducer, the core's settle loop and the marker reader decide with. They are estimates that nobody has timed on a real machine yet: they are to be tared from the first real runs, and so they live in one place and are tested by value.

type Unit

type Unit struct {
	Active, Answered bool
	SilentSince      time.Time
}

Unit is what systemd says of the upgrade's unit. Answered is false when systemd did not answer within the bound the caller gave it: nothing is then inferred from the unit, and nothing is launched. SilentSince is when systemd was first seen not answering, in the run of unanswered questions that is still going on; it is zero when the caller does not know, and the time since the last sign of life of the run stands for it then.

type VerifyResult

type VerifyResult struct {
	Errors, Warnings int
}

VerifyResult is what the judge found after the restart: how many findings of each severity that count. Findings that are only information never change a state, and are not here.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL