service

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(u *Unit) error

Create writes a systemd unit file and reloads the daemon.

func Logs

func Logs(name string, lines string) (string, error)

Logs returns recent log lines for a service.

func Remove

func Remove(name string) error

Remove removes a service unit file. Silently skips if it doesn't exist.

func Restart

func Restart(name string) error

Restart restarts a service.

func Start

func Start(name string) error

Start enables and starts a service.

func Status

func Status(name string) (string, error)

Status returns the active state of a service.

func Stop

func Stop(name string) error

Stop stops and disables a service. Silently skips if the service doesn't exist.

func TunnelServiceName

func TunnelServiceName(tag string) string

TunnelServiceName returns the systemd service name for a tunnel.

Types

type Unit

type Unit struct {
	Name        string
	Description string
	ExecStart   string
	User        string
	Group       string
	After       string
	Restart     string
	WorkingDir  string
	Environment []string
}

Unit represents a systemd unit file.

Jump to

Keyboard shortcuts

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