Example #1
0
File: main.go Project: yubo/falcon
func start(arg interface{}) {
	app := specs.NewProcess(pidfile, []specs.Module{specs.Module(&ct)})

	if err := app.Check(); err != nil {
		glog.Fatal(err)
	}
	if err := app.Save(); err != nil {
		glog.Fatal(err)
	}

	runtime.GOMAXPROCS(runtime.NumCPU())

	app.Start()
}
Example #2
0
File: main.go Project: yubo/falcon
func stop(arg interface{}) {
	app := specs.NewProcess(pidfile, []specs.Module{specs.Module(&ct)})
	if err := app.Kill(syscall.SIGTERM); err != nil {
		glog.Fatal(err)
	}
}