Merge pull request #127 from jonboulle/127
"Enable" option does not support units in /usr/lib64/systemd
This commit is contained in:
		| @@ -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) | ||||
|   | ||||
| @@ -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 | ||||
| } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user