-
Notifications
You must be signed in to change notification settings - Fork 321
Closed
Description
What Happens:
Calling the ListUnitsByNames function on *dbus.Conn results in an unexpected error: Unknown method 'ListUnitsByNames' or interface 'org.freedesktop.systemd1.Manager'
What I expected to happen:
A slice of UnitStatus and no error, or a more descriptive error message.
How to reproduce:
Sample Code:
package main
import (
"fmt"
"github.com/coreos/go-systemd/dbus"
)
func main() {
conn, err := dbus.New()
if err != nil {
fmt.Println("error getting connection: ", err)
}
res, err := conn.ListUnitsByNames([]string{"acpid.service"})
if err != nil {
fmt.Println("error with ListUnitsByNames: ", err)
return
}
fmt.Printf("got %d results\n", len(res))
}
Test system:
uname -a; lsb_release -a
Linux rebecca-vboxdev 4.4.0-62-generic #83-Ubuntu SMP Wed Jan 18 14:10:15 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.2 LTS
Release: 16.04
Codename: xenial
Metadata
Metadata
Assignees
Labels
No labels