wrappers

package
v0.0.0-...-115137c Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2021 License: GPL-3.0 Imports: 30 Imported by: 0

Documentation

Overview

Package wrappers is used to generate wrappers and service units and also desktop files for snap applications.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddSnapBinaries

func AddSnapBinaries(s *snap.Info) (err error)

AddSnapBinaries writes the wrapper binaries for the applications from the snap which aren't services.

func AddSnapDBusActivationFiles

func AddSnapDBusActivationFiles(s *snap.Info) error

func AddSnapDesktopFiles

func AddSnapDesktopFiles(s *snap.Info) (err error)

AddSnapDesktopFiles puts in place the desktop files for the applications from the snap.

func AddSnapIcons

func AddSnapIcons(s *snap.Info) error

func AddSnapServices

func AddSnapServices(s *snap.Info, opts *AddSnapServicesOptions, inter interacter) (err error)

AddSnapServices adds service units for the applications from the snap which are services. The services do not get enabled or started.

func AddSnapdSnapServices

func AddSnapdSnapServices(s *snap.Info, inter interacter) error

AddSnapdSnapServices sets up the services based on a given snapd snap in the system.

func DeriveSnapdDBusConfig

func DeriveSnapdDBusConfig(s *snap.Info) (sessionContent, systemContent map[string]osutil.FileState, err error)

func QueryDisabledServices

func QueryDisabledServices(info *snap.Info, pb progress.Meter) ([]string, error)

QueryDisabledServices returns a list of all currently disabled snap services in the snap.

func RemoveSnapBinaries

func RemoveSnapBinaries(s *snap.Info) error

RemoveSnapBinaries removes the wrapper binaries for the applications from the snap which aren't services from.

func RemoveSnapDBusActivationFiles

func RemoveSnapDBusActivationFiles(s *snap.Info) error

func RemoveSnapDesktopFiles

func RemoveSnapDesktopFiles(s *snap.Info) error

RemoveSnapDesktopFiles removes the added desktop files for the applications in the snap.

func RemoveSnapIcons

func RemoveSnapIcons(s *snap.Info) error

func RemoveSnapServices

func RemoveSnapServices(s *snap.Info, inter interacter) error

RemoveSnapServices disables and removes service units for the applications from the snap which are services. The optional flag indicates whether services are removed as part of undoing of first install of a given snap.

func RemoveSnapdSnapServicesOnCore

func RemoveSnapdSnapServicesOnCore(s *snap.Info, inter interacter) error

RemoveSnapdSnapServicesOnCore removes the snapd services generated by a prior call to AddSnapdSnapServices. The core snap is used as the reference for restoring the system state, making this undo helper suitable for use when reverting the first installation of the snapd snap on a core device.

func RestartServices

func RestartServices(svcs []*snap.AppInfo, flags *RestartServicesFlags, inter interacter, tm timings.Measurer) error

Restart or reload services; if reload flag is set then "systemctl reload-or-restart" is attempted.

func ServicesEnableState

func ServicesEnableState(s *snap.Info, inter interacter) (map[string]bool, error)

ServicesEnableState returns a map of service names from the given snap, together with their enable/disable status.

func StartServices

func StartServices(apps []*snap.AppInfo, disabledSvcs []string, flags *StartServicesFlags, inter interacter, tm timings.Measurer) (err error)

StartServices starts service units for the applications from the snap which are services. Service units will be started in the order provided by the caller.

func StopServices

func StopServices(apps []*snap.AppInfo, flags *StopServicesFlags, reason snap.ServiceStopReason, inter interacter, tm timings.Measurer) error

StopServices stops and optionally disables service units for the applications from the snap which are services.

Types

type AddSnapServicesOptions

type AddSnapServicesOptions struct {
	Preseeding              bool
	VitalityRank            int
	RequireMountedSnapdSnap bool
}

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

type RestartServicesFlags

type RestartServicesFlags struct {
	Reload bool
}

type StartServicesFlags

type StartServicesFlags struct {
	Enable bool
}

StartServicesFlags carries extra flags for StartServices.

type StopServicesFlags

type StopServicesFlags struct {
	Disable bool
}

StopServicesFlags carries extra flags for StopServices.

Jump to

Keyboard shortcuts

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