Пример #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
}
Пример #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
}
Пример #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()
}