예제 #1
0
파일: confd.go 프로젝트: ngpestelos/deis
// Launch launch confd as a daemon process.
func Launch(signalChan chan os.Signal, etcd []string) {
	confdLogLevel := "error"
	if log.Level.String() == "debug" {
		confdLogLevel = "debug"
	}
	cmdAsString := fmt.Sprintf("confd -node %v -confdir /app --interval %v --log-level %v", confdInterval, strings.Join(etcd, ","), confdLogLevel)
	cmd, args := oswrapper.BuildCommandFromString(cmdAsString)
	go runConfdDaemon(signalChan, cmd, args)
}
예제 #2
0
파일: confd.go 프로젝트: ngpestelos/deis
// WaitForInitialConf wait until the compilation of the templates is correct
func WaitForInitialConf(etcd []string, timeout time.Duration) {
	log.Info("waiting for confd to write initial templates...")
	for {
		cmdAsString := fmt.Sprintf("confd -onetime -node %v -confdir /app", strings.Join(etcd, ","))
		log.Debugf("running %s", cmdAsString)
		cmd, args := oswrapper.BuildCommandFromString(cmdAsString)
		err := oswrapper.RunCommand(cmd, args)
		if err == nil {
			break
		}

		time.Sleep(timeout)
	}
}