Esempio n. 1
0
func initializeSlices() error {
	for _, unit := range sliceUnits {
		if err := systemd.InitializeSystemdFile(systemd.SliceType, unit.Name, csystemd.SliceUnitTemplate, unit, false); nil != err {
			return err
		}
	}
	return nil
}
Esempio n. 2
0
func initializeTargets() error {
	for _, target := range [][]string{
		{"container", ""},
		{"container-sockets", ""},
		{"container-active", "multi-user.target"},
	} {
		name, wants := target[0], target[1]
		if err := systemd.InitializeSystemdFile(systemd.TargetType, name, csystemd.TargetUnitTemplate, csystemd.TargetUnit{name, wants}, false); err != nil {
			return err
		}
	}
	return nil
}
Esempio n. 3
0
func initializeSlices() error {
	for _, name := range []string{
		"container",
		"container-small",
	} {
		parent := "container"
		if name == "container" {
			parent = ""
		}

		if err := systemd.InitializeSystemdFile(systemd.SliceType, name, csystemd.SliceUnitTemplate, csystemd.SliceUnit{name, parent}, false); err != nil {
			return err
		}
	}
	return nil
}
Esempio n. 4
0
func initializeRouter() error {
	if err := systemd.InitializeSystemdFile(systemd.UnitType, hostServiceName, rjobs.UnitRouterTemplate, nil, false); err != nil {
		return err
	}
	systemd.IsUnitProperty(systemd.Connection(), hostServiceName+".service", func(p map[string]interface{}) bool {
		switch p["ActiveState"] {
		case "active":
			break
		case "activating":
			log.Printf("The Router host service '" + hostServiceName + "' is starting - routing tasks will not be available until it completes")
		default:
			log.Printf("The Router host service '" + hostServiceName + "' is not started - router operations will not be available")
		}
		return true
	})
	return nil
}
Esempio n. 5
0
func initializeGitHost() error {
	return systemd.InitializeSystemdFile(systemd.UnitType, "geard-githost", UnitGitHostTemplate, nil, true)
}
Esempio n. 6
0
func initializeSlices() error {
	return systemd.InitializeSystemdFile(systemd.SliceType, "geard-githost", SliceGitTemplate, nil, false)
}
Esempio n. 7
0
func initializeSlices() error {
	return systemd.InitializeSystemdFile(systemd.SliceType, hostServiceName, rjobs.SliceRouterTemplate, nil, false)
}