diff --git a/initialize/config.go b/initialize/config.go index 5f5c89b..8a2e45a 100644 --- a/initialize/config.go +++ b/initialize/config.go @@ -254,8 +254,8 @@ func Apply(cfg CloudConfig, env *Environment) error { if unit.Enable { if unit.Group() != "network" { - log.Printf("Enabling unit file %s", dst) - if err := system.EnableUnitFile(dst, unit.Runtime); err != nil { + log.Printf("Enabling unit file %s", unit.Name) + if err := system.EnableUnitFile(unit.Name, unit.Runtime); err != nil { return err } log.Printf("Enabled unit %s", unit.Name) diff --git a/system/systemd.go b/system/systemd.go index 48caaaf..d87f57a 100644 --- a/system/systemd.go +++ b/system/systemd.go @@ -91,14 +91,14 @@ func PlaceUnit(u *Unit, dst string) error { return nil } -func EnableUnitFile(file string, runtime bool) error { +func EnableUnitFile(unit string, runtime bool) error { conn, err := dbus.New() if err != nil { return err } - files := []string{file} - _, _, err = conn.EnableUnitFiles(files, runtime, true) + units := []string{unit} + _, _, err = conn.EnableUnitFiles(units, runtime, true) return err }