systemd

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: CC0-1.0 Imports: 13 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 systemd implements socket activation, notifications and user units.

Index

Constants

View Source
const NixStoreDir = "/nix/store"

NixStoreDir is the directory whose contents can vanish after an upgrade.

Variables

View Source
var ErrStoreBinary = errors.New("binary is in the Nix store")

ErrStoreBinary reports an executable in the Nix store that no Nix profile links to.

Functions

func CheckUnitPath

func CheckUnitPath(field, path string) error

CheckUnitPath reports whether path may be written into a unit file (the rule RenderUnits already applies); field names the path in the error.

func Listeners

func Listeners() (map[string]net.Listener, error)

Listeners consumes systemd's named descriptors and clears the activation environment. A process that was not socket-activated gets nil, nil.

func NixProfileBins

func NixProfileBins(home, stateHome, user string) []string

NixProfileBins returns the P§6 profile bin directories in order. Empty home, stateHome or user drop the entries that need them.

func Notify

func Notify(state string) error

Notify sends one sd_notify datagram. An unset NOTIFY_SOCKET is a no-op.

func RenderUnits

func RenderUnits(d UnitData) (service, socket []byte, err error)

RenderUnits renders the architecture's user units. Callers install both files with mode 0644, including when their process umask is 0077.

func StableBinary

func StableBinary(exe string, profileBins []string) (string, error)

StableBinary returns the path systemd units should execute for exe (P§6).

Types

type UnitData

type UnitData struct {
	Binary, Socket, DataDir, StateDir, RuntimeDir string
	ExtraRW                                       []string
}

UnitData supplies the resolved paths for the systemd user unit templates.

Jump to

Keyboard shortcuts

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