nftinstall

package
v0.1.90-dev.6 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: AGPL-3.0 Imports: 10 Imported by: 0 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 nftinstall puts the nftables package on a server that lacks it (a cloud image of Debian 13 has no nft command, and the agent's firewall steps need it). The doctor's fix install_nftables starts it as a transient root unit, outside the agent's service sandbox, the way the security updates job runs; the status file carries the result back.

Index

Constants

View Source
const (
	UnitName       = "mistgate-install-nftables"
	StatusFileName = "install-nftables.json"

	// JobTimeout bounds the task's waits; an apt-get that has started is never cut by it (awgprep.AptInstall), only the
	// unit's RuntimeMaxSec (30 minutes) stops a hung one.
	JobTimeout = 20 * time.Minute
	// LockWait bounds the wait for a package manager already using dpkg (a fresh image runs cloud-init and
	// unattended-upgrades in its first minutes).
	LockWait = 10 * time.Minute
)
View Source
const Package = "nftables"

Package is what the job installs.

Variables

This section is empty.

Functions

func InstallArgs

func InstallArgs() []string

InstallArgs is the apt-get argument list: no questions, no recommended packages, the dpkg lock waited for.

func SystemdRun

func SystemdRun(exe, statusPath string) func(context.Context) error

SystemdRun starts the job as a transient root unit. systemd-run returns when the unit starts; the status file carries the eventual result.

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
	// Installed says whether nft is there (nil = nftmissing.Installed); HasApt whether apt-get is (nil = on PATH).
	Installed func() bool
	HasApt    func() bool
}

Job installs nftables without upgrading anything else and without touching a running service.

func (Job) Do

func (j Job) Do(ctx context.Context) error

Do runs the bounded job and leaves the shared awgprep status format at StatusPath when asked.

Jump to

Keyboard shortcuts

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