systemctl

package
v0.4.11-alpha5 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2025 License: Apache-2.0 Imports: 5 Imported by: 11 modules, 15 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// `done` indicates successful execution of a job.
	ResultDone = "done"

	// `canceled` indicates that a job has been canceled before it finished execution.
	ResultCanceled = "canceled"
	ErrorCanceled  = errors.New("job has been canceled before it finished execution")

	// `timeout` indicates that the job timeout was reached.
	ResultTimeout = "timeout"
	ErrorTimeout  = errors.New("job timeout was reached")

	// `failed` indicates that the job failed.
	ResultFailed = "failed"
	ErrorFailed  = errors.New("job failed")

	// `dependency` indicates that a job this job has been depending on failed and the job hence has been removed too.
	ResultDependency = "dependency"
	ErrorDependency  = errors.New("another job this job has been depending on failed and the job hence has been removed too")

	// `skipped` indicates that a job was skipped because it didn't apply to the units current state.
	ResultSkipped = "skipped"
	ErrorSkipped  = errors.New("job was skipped because it didn't apply to the units current state")

	ErrorMap = map[string]error{
		ResultDone:       nil,
		ResultCanceled:   ErrorCanceled,
		ResultTimeout:    ErrorTimeout,
		ResultFailed:     ErrorFailed,
		ResultDependency: ErrorDependency,
		ResultSkipped:    ErrorSkipped,
	}

	ErrorUnknown = errors.New("unknown error")
)

Functions

func DisableService

func DisableService(name string, wait ...time.Duration) error

func EnableService

func EnableService(nameOrPath string, wait ...time.Duration) error

func IsServiceEnabled

func IsServiceEnabled(name string, wait ...time.Duration) (bool, error)

func IsServiceRunning

func IsServiceRunning(name string, wait ...time.Duration) (bool, error)

func ReloadDaemon added in v0.4.0

func ReloadDaemon(wait ...time.Duration) error

func RestartService added in v0.4.15

func RestartService(name string, wait ...time.Duration) error

func StartService added in v0.4.0

func StartService(name string, wait ...time.Duration) error

func StopService added in v0.4.0

func StopService(name string, wait ...time.Duration) error

Types

type Service added in v0.4.2

type Service struct {
	Name    string
	Running bool
}

func ListServices added in v0.4.2

func ListServices(pattern string, wait ...time.Duration) ([]Service, error)

Jump to

Keyboard shortcuts

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