Documentation
¶
Index ¶
Constants ¶
View Source
const (
// ServiceSuffix is the suffix for service files. This includes the dot.
ServiceSuffix = ".service"
)
Variables ¶
This section is empty.
Functions ¶
func DefaultUnitType ¶
DefaultUnitType appends the default unit type to a given unit name, ignoring any file extensions that already exist.
Types ¶
type File ¶
type File struct { Contents map[string]map[string][]string Options []*unit.UnitOption }
A File represents a systemd configuration which encodes information about any of the unit types that fleet supports (as defined in SupportedUnitTypes()).
func (*File) Description ¶
Description returns the first Description option found in the [Unit] section. If the option is not defined, an empty string is returned.
type Manager ¶
type Manager interface { // this is an interface mostly for testing. Disable(name string) error Load(name string, u File) error Mask(name string) error Properties(name string) (map[string]interface{}, error) Property(name, property string) string Reload() error ServiceProperty(name, property string) string State(name string) (*State, error) States(prefix string) (map[string]*State, error) TriggerStart(name string) error TriggerStop(name string) error Unit(name string) string Units() ([]string, error) Unload(name string) error }
Manager owns the management of systemd units.
func NewManager ¶
NewManager returns an initialized dBus unit manager.
func NewMockManager ¶
type State ¶
type State struct { dbus.UnitStatus UnitData string // the unit file as written to disk }
State encodes the current state of a unit loaded into a systemk agent
Click to show internal directories.
Click to hide internal directories.