balena-supervisor/gosuper/systemd/systemd.go

26 lines
565 B
Go
Raw Normal View History

2015-08-25 19:40:54 +00:00
package systemd
import (
"log"
2015-09-24 15:51:33 +00:00
"resin-supervisor/gosuper/Godeps/_workspace/src/github.com/coreos/go-systemd/dbus"
"resin-supervisor/gosuper/Godeps/_workspace/src/github.com/coreos/go-systemd/login1"
2015-08-25 19:40:54 +00:00
)
var (
// Logind Systemd Login1 connection
Logind *login1.Conn
// Dbus Systems Dbus connection
Dbus *dbus.Conn
)
2015-09-24 15:51:33 +00:00
2015-08-25 19:40:54 +00:00
func init() {
var err error
if Logind, err = login1.New(); err != nil {
log.Fatalf("Failed to connect to host system bus: %s", err)
2015-08-25 19:40:54 +00:00
}
2015-09-24 15:51:33 +00:00
if Dbus, err = dbus.New(); err != nil {
log.Fatalf("Failed to connect to host DBUS: %s", err)
2015-09-24 15:51:33 +00:00
}
2015-08-25 19:40:54 +00:00
}