mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2024-12-24 07:46:41 +00:00
fc4b9656cd
Change-Type: patch Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
26 lines
471 B
Go
26 lines
471 B
Go
package systemd
|
|
|
|
import (
|
|
"log"
|
|
|
|
"github.com/coreos/go-systemd/dbus"
|
|
"github.com/coreos/go-systemd/login1"
|
|
)
|
|
|
|
var (
|
|
// Logind Systemd Login1 connection
|
|
Logind *login1.Conn
|
|
// Dbus Systems Dbus connection
|
|
Dbus *dbus.Conn
|
|
)
|
|
|
|
func init() {
|
|
var err error
|
|
if Logind, err = login1.New(); err != nil {
|
|
log.Printf("Failed to connect to host system bus: %s", err)
|
|
}
|
|
if Dbus, err = dbus.New(); err != nil {
|
|
log.Printf("Failed to connect to host DBUS: %s", err)
|
|
}
|
|
}
|