• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

activation/H28-Feb-2018-

daemon/H28-Feb-2018-

dbus/H28-Feb-2018-

examples/activation/H28-Feb-2018-

fixtures/H28-Feb-2018-

journal/H28-Feb-2018-

login1/H28-Feb-2018-

machine1/H28-Feb-2018-

scripts/jenkins/H28-Feb-2018-

sdjournal/H28-Feb-2018-

unit/H28-Feb-2018-

util/H28-Feb-2018-

.travis.ymlH A D28-Feb-20181 KiB

CONTRIBUTING.mdH A D28-Feb-20182.6 KiB

DCOH A D28-Feb-20181.4 KiB

JenkinsfileH A D28-Feb-2018773

LICENSEH A D28-Feb-201810 KiB

NOTICEH A D28-Feb-2018126

README.mdH A D28-Feb-20182.2 KiB

code-of-conduct.mdH A D28-Feb-20183 KiB

testH A D28-Feb-20182 KiB

README.md

1# go-systemd
2
3[![Build Status](https://travis-ci.org/coreos/go-systemd.png?branch=master)](https://travis-ci.org/coreos/go-systemd)
4[![godoc](https://godoc.org/github.com/coreos/go-systemd?status.svg)](http://godoc.org/github.com/coreos/go-systemd)
5
6Go bindings to systemd. The project has several packages:
7
8- `activation` - for writing and using socket activation from Go
9- `dbus` - for starting/stopping/inspecting running services and units
10- `journal` - for writing to systemd's logging service, journald
11- `sdjournal` - for reading from journald by wrapping its C API
12- `machine1` - for registering machines/containers with systemd
13- `unit` - for (de)serialization and comparison of unit files
14
15## Socket Activation
16
17An example HTTP server using socket activation can be quickly set up by following this README on a Linux machine running systemd:
18
19https://github.com/coreos/go-systemd/tree/master/examples/activation/httpserver
20
21## Journal
22
23Using the pure-Go `journal` package you can submit journal entries directly to systemd's journal, taking advantage of features like indexed key/value pairs for each log entry.
24The `sdjournal` package provides read access to the journal by wrapping around journald's native C API; consequently it requires cgo and the journal headers to be available.
25
26## D-Bus
27
28The `dbus` package connects to the [systemd D-Bus API](http://www.freedesktop.org/wiki/Software/systemd/dbus/) and lets you start, stop and introspect systemd units. The API docs are here:
29
30http://godoc.org/github.com/coreos/go-systemd/dbus
31
32### Debugging
33
34Create `/etc/dbus-1/system-local.conf` that looks like this:
35
36```
37<!DOCTYPE busconfig PUBLIC
38"-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN"
39"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
40<busconfig>
41    <policy user="root">
42        <allow eavesdrop="true"/>
43        <allow eavesdrop="true" send_destination="*"/>
44    </policy>
45</busconfig>
46```
47
48## machined
49
50The `machine1` package allows interaction with the [systemd machined D-Bus API](http://www.freedesktop.org/wiki/Software/systemd/machined/).
51
52## Units
53
54The `unit` package provides various functions for working with [systemd unit files](http://www.freedesktop.org/software/systemd/man/systemd.unit.html).
55