Exemplo n.º 1
0
func FindServices() []model.Service {
	services := readServiceFiles(configuration.C.Paths.Services)
	if len(services) < 1 {
		log.Panic("No services found! This makes me useless! Panic!")
	}
	return services
}
Exemplo n.º 2
0
func readFile(path string) []byte {
	raw, err := ioutil.ReadFile(path)
	if err != nil {
		log.Panic("Cannot read file: ", path, err.Error())
	}
	return raw
}
Exemplo n.º 3
0
//Boot handles flags and initializes configuration
func Boot() {
	configuration.Init(config)
	configuration.Debug = debug
	configuration.AutoStart = autoStart

	if testConfig {
		err := TestConfiguration()
		if err != nil {
			log.Panic(err)
		} else {
			os.Exit(0)
		}
	}

	if noActionHandling {
		configuration.C.NoActionHandling = true
	}

	if configuration.AutoStart {
		daemon.Start()
	}

	daemon.Spawn()
}