Merge pull request #127 from jonboulle/127

"Enable" option does not support units in /usr/lib64/systemd
This commit is contained in:
Jonathan Boulle 2014-05-26 15:24:30 -07:00
commit db3f008543
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.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)

View File

@ -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
}