internal

package
v0.0.0-...-2fa4796 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2025 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateQuotaJournalServiceFile

func GenerateQuotaJournalServiceFile(grp *quota.Group) []byte

func GenerateQuotaJournaldConfFile

func GenerateQuotaJournaldConfFile(grp *quota.Group) []byte

func GenerateQuotaSliceUnitFile

func GenerateQuotaSliceUnitFile(grp *quota.Group) []byte

GenerateQuotaSliceUnitFile generates a systemd slice unit definition for the specified quota group.

func GenerateSnapServiceTimerUnitFile

func GenerateSnapServiceTimerUnitFile(app *snap.AppInfo) ([]byte, error)

func GenerateSnapServiceUnitFile

func GenerateSnapServiceUnitFile(appInfo *snap.AppInfo, opts *SnapServicesUnitOptions) ([]byte, error)

func GenerateSnapSocketUnitFiles

func GenerateSnapSocketUnitFiles(app *snap.AppInfo) (map[string][]byte, error)

func SnapServiceUnits

func SnapServiceUnits(app *snap.AppInfo) (service string, activators []string)

SnapServiceUnits returns the service unit of the primary service, and a list of service units for the activation services.

Types

type ServiceStatus

type ServiceStatus struct {
	// contains filtered or unexported fields
}

ServiceStatus represents the status of a service, and any of its activation service units. It also provides helper methods to access or calculate certain properties of the service.

func QueryServiceStatusMany

func QueryServiceStatusMany(apps []*snap.AppInfo, sysd systemd.Systemd) (sysSvcs []*ServiceStatus, userSvcs map[int][]*ServiceStatus, err error)

QueryServiceStatusMany queries service statuses for all the provided apps. A list of system-service statuses is returned, and a map detailing the statuses of services per logged in user.

func (*ServiceStatus) ActivatorUnitStatuses

func (s *ServiceStatus) ActivatorUnitStatuses() []*systemd.UnitStatus

ActivatorUnitStatuses returns the systemd.UnitStatus instances that represent any activator service units of this service.

func (*ServiceStatus) IsEnabled

func (s *ServiceStatus) IsEnabled() bool

IsEnabled returns whether the service is enabled, and takes into account whether the service has activator units.

func (*ServiceStatus) IsUserService

func (s *ServiceStatus) IsUserService() bool

IsUserService returns whether the service is a user-daemon.

func (*ServiceStatus) Name

func (s *ServiceStatus) Name() string

Name returns the human readable name of the service.

func (*ServiceStatus) ServiceUnitStatus

func (s *ServiceStatus) ServiceUnitStatus() *systemd.UnitStatus

ServiceUnitStatus returns the systemd.UnitStatus instance representing the service.

type SnapServicesUnitOptions

type SnapServicesUnitOptions struct {
	// VitalityRank is the rank of all services in the specified snap used by
	// the OOM killer when OOM conditions are reached.
	VitalityRank int

	// QuotaGroup is the quota group for the service.
	QuotaGroup *quota.Group

	// CoreMountedSnapdSnapDep is whether the generated unit should depend on
	// the provided snapd snapd being mounted
	CoreMountedSnapdSnapDep string
}

SnapServicesUnitOptions is a struct for controlling the generated service definition for a snap service.

Jump to

Keyboard shortcuts

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