systemd

package
v0.0.0-...-2bbd57e Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultUnitsDirectory represents the directory of user-defined systemd units
	DefaultUnitsDirectory = "/run/systemd/system"
)

Variables

This section is empty.

Functions

func Asset

func Asset(name string) ([]byte, error)

Asset loads and returns the asset for the given name. It returns an error if the asset could not be found or could not be loaded.

func AssetDir

func AssetDir(name string) ([]string, error)

AssetDir returns the file names below a certain directory embedded in the file by go-bindata. For example if you run go-bindata on data/... and data contains the following hierarchy:

data/
  foo.txt
  img/
    a.png
    b.png

then AssetDir("data") would return []string{"foo.txt", "img"} AssetDir("data/img") would return []string{"a.png", "b.png"} AssetDir("foo.txt") and AssetDir("notexist") would return an error AssetDir("") will return []string{"data"}.

func AssetNames

func AssetNames() []string

AssetNames returns the names of the assets.

func GenerateService

func GenerateService(name, command, after, user string) (string, error)

GenerateService generates new systemd Service

func GenerateTimer

func GenerateTimer(name, cronspec string) (string, error)

GenerateTimer generates new systemd Timer

func NewConn

func NewConn() (*dbus.Conn, error)

NewConn establishes a new connection to D-Bus

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client represents systemd D-Bus API client.

func NewClient

func NewClient(conn *dbus.Conn) *Client

NewClient creates new Client object

func (*Client) Reload

func (c *Client) Reload() error

Reload reloads systemd unit files

func (*Client) StartUnit

func (c *Client) StartUnit(name string) error

StartUnit starts the given systemd unit file

type ServiceData

type ServiceData struct {
	Name    string
	Command string
	After   string
	User    string
}

ServiceData represents data set of systemd Service

type TimerData

type TimerData struct {
	Name     string
	Cronspec string
}

TimerData represents data set of systemd Timer

Jump to

Keyboard shortcuts

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