Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 03-May-2022 | - | ||||
activation/ | H | 28-Feb-2018 | - | |||
daemon/ | H | 28-Feb-2018 | - | |||
dbus/ | H | 28-Feb-2018 | - | |||
examples/activation/ | H | 28-Feb-2018 | - | |||
fixtures/ | H | 28-Feb-2018 | - | |||
journal/ | H | 28-Feb-2018 | - | |||
login1/ | H | 28-Feb-2018 | - | |||
machine1/ | H | 28-Feb-2018 | - | |||
scripts/jenkins/ | H | 28-Feb-2018 | - | |||
sdjournal/ | H | 28-Feb-2018 | - | |||
unit/ | H | 28-Feb-2018 | - | |||
util/ | H | 28-Feb-2018 | - | |||
.travis.yml | H A D | 28-Feb-2018 | 1 KiB | |||
CONTRIBUTING.md | H A D | 28-Feb-2018 | 2.6 KiB | |||
DCO | H A D | 28-Feb-2018 | 1.4 KiB | |||
Jenkinsfile | H A D | 28-Feb-2018 | 773 | |||
LICENSE | H A D | 28-Feb-2018 | 10 KiB | |||
NOTICE | H A D | 28-Feb-2018 | 126 | |||
README.md | H A D | 28-Feb-2018 | 2.2 KiB | |||
code-of-conduct.md | H A D | 28-Feb-2018 | 3 KiB | |||
test | H A D | 28-Feb-2018 | 2 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