Documentation ¶
Index ¶
- func GenerateQuotaJournalServiceFile(grp *quota.Group) []byte
- func GenerateQuotaJournaldConfFile(grp *quota.Group) []byte
- func GenerateQuotaSliceUnitFile(grp *quota.Group) []byte
- func GenerateSnapServiceTimerUnitFile(app *snap.AppInfo) ([]byte, error)
- func GenerateSnapServiceUnitFile(appInfo *snap.AppInfo, opts *SnapServicesUnitOptions) ([]byte, error)
- func GenerateSnapSocketUnitFiles(app *snap.AppInfo) (map[string][]byte, error)
- func SnapServiceUnits(app *snap.AppInfo) (service string, activators []string)
- type ServiceStatus
- type SnapServicesUnitOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateQuotaSliceUnitFile ¶
GenerateQuotaSliceUnitFile generates a systemd slice unit definition for the specified quota group.
func GenerateSnapServiceUnitFile ¶
func GenerateSnapServiceUnitFile(appInfo *snap.AppInfo, opts *SnapServicesUnitOptions) ([]byte, error)
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.