Documentation
¶
Index ¶
Constants ¶
const ( UnitName = "mistgate-security-updates" StatusFileName = "security-updates.json" // JobTimeout bounds the task's waits and quick steps. An apt-get install that has started is never cut by it: dpkg // killed in the middle of a transaction leaves the host half configured, so only the unit's RuntimeMaxSec (30 // minutes) stops a hung one. JobTimeout = 20 * time.Minute // LockWait bounds the initial wait for a package manager already using dpkg. LockWait = 10 * time.Minute // TimerStampDir is where systemd keeps the last run of a Persistent=true timer (stamp-<timer>). TimerStampDir = "/var/lib/systemd/timers" )
const AptConfigCommand = "apt-config"
const AptPeriodicArgs = "shell E APT::Periodic::Enable L APT::Periodic::Update-Package-Lists U APT::Periodic::Unattended-Upgrade"
const CodeOverridden = "overridden"
const ConfigPath = "/etc/apt/apt.conf.d/99mistgate-security-updates"
Variables ¶
This section is empty.
Functions ¶
func ConfigFor ¶
ConfigFor is the override file that switches the given settings on (each once, in a fixed order; unknown keys are dropped).
func ManagedKeys ¶
ManagedKeys are the settings an earlier run already switched on in the override file (body = its content). A new run keeps them: without them the owner's lower-numbered "0" would count again.
Types ¶
type Job ¶
type Job struct {
StatusPath string
Timeout time.Duration
LockWait time.Duration
Out io.Writer
Run awgprep.Runner
Sys awgprep.Sys
Now func() time.Time
// ReadFile reads Mistgate's override file from an earlier run. Nil = os.ReadFile.
ReadFile func(string) ([]byte, error)
}
Job enables unattended security updates without applying upgrades itself.
type Periodic ¶
Periodic contains the effective APT::Periodic values printed by `apt-config shell`.
func ParsePeriodicShell ¶
ParsePeriodicShell reads apt-config's shell assignments without evaluating them.
func (Periodic) ConfigForDisabled ¶
ConfigForDisabled returns only the settings that need to be enabled in Mistgate's override file.
func (Periodic) DisabledKeys ¶
DisabledKeys lists the effective settings that keep automatic package updates off.
func (Periodic) OffDetails ¶
OffDetails returns the raw setting names and values used in the doctor warning.