services

package
v0.0.0-...-e06cd52 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorNotImplementedForOS = errors.New("Services list not implemented for " + runtime.GOOS)

ErrorNotImplementedForOS returned in case we don't yet implement service manager parsing or this OS. Should be checked and ignored

Functions

func ListServices

func ListServices(autostartOnly bool) (map[string]interface{}, error)

ListServices detect the linux system manager and parse/combine results

Types

type OpenRCService

type OpenRCService struct {
	UnitFile string
	State    string
}

OpenRCService contains the service data parsed from rc-status (OpenRC init system)

type SysVService

type SysVService struct {
	UnitFile string
	State    string
}

SysVService contains the service data parsed from service(Sysvinit) or initctl(Upstart)

func ListUpstartServices

func ListUpstartServices() ([]SysVService, error)

ListUpstartServices list upstart services via `initctl list`. Returns []SysVService because Upstart is compatible with SysVInit and has the same details

type SystemdService

type SystemdService struct {
	UnitFile    string
	UnitState   string
	LoadState   string
	ActiveState string
	State       string
	Description string
}

SystemdService contains the service data parsed from systemctl

Jump to

Keyboard shortcuts

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