systemd

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2017 License: MIT Imports: 4 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 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