From b04509ae541aeaaa47068101f0a513bb263629a6 Mon Sep 17 00:00:00 2001 From: Jonathan Boulle Date: Mon, 26 May 2014 15:16:24 -0700 Subject: [PATCH] fix(systemd): EnableUnitFile unit name rather than absolute destination --- initialize/config.go | 4 ++-- system/systemd.go | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) 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 }