fix(systemd): EnableUnitFile unit name rather than absolute destination

This commit is contained in:
Jonathan Boulle 2014-05-26 15:16:24 -07:00
parent 6c07e8784f
commit b04509ae54
2 changed files with 5 additions and 5 deletions

View File

@ -254,8 +254,8 @@ func Apply(cfg CloudConfig, env *Environment) error {
if unit.Enable { if unit.Enable {
if unit.Group() != "network" { if unit.Group() != "network" {
log.Printf("Enabling unit file %s", dst) log.Printf("Enabling unit file %s", unit.Name)
if err := system.EnableUnitFile(dst, unit.Runtime); err != nil { if err := system.EnableUnitFile(unit.Name, unit.Runtime); err != nil {
return err return err
} }
log.Printf("Enabled unit %s", unit.Name) log.Printf("Enabled unit %s", unit.Name)

View File

@ -91,14 +91,14 @@ func PlaceUnit(u *Unit, dst string) error {
return nil return nil
} }
func EnableUnitFile(file string, runtime bool) error { func EnableUnitFile(unit string, runtime bool) error {
conn, err := dbus.New() conn, err := dbus.New()
if err != nil { if err != nil {
return err return err
} }
files := []string{file} units := []string{unit}
_, _, err = conn.EnableUnitFiles(files, runtime, true) _, _, err = conn.EnableUnitFiles(units, runtime, true)
return err return err
} }