Example #1
0
func parse(arg interface{}) {
	opts := arg.(*specs.CmdOpts)
	conf := conf.Parse(opts.ConfigFile, true)
	dir, _ := os.Getwd()
	glog.Infof("work dir :%s", dir)
	glog.Infof("\n%s", conf)
}
Example #2
0
func reload(arg interface{}) {
	opts := arg.(*specs.CmdOpts)
	conf := conf.Parse(opts.ConfigFile, false)
	app := specs.NewProcess(conf.PidFile, conf.Modules)

	if err := app.Kill(syscall.SIGUSR1); err != nil {
		glog.Fatal(err)
	}
}
Example #3
0
func start(arg interface{}) {
	opts := arg.(*specs.CmdOpts)
	conf := conf.Parse(opts.ConfigFile, false)
	app := specs.NewProcess(conf.PidFile, conf.Modules)

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

	dir, _ := os.Getwd()
	glog.V(4).Infof("work dir :%s", dir)
	glog.V(4).Infof("\n%s", conf)

	runtime.GOMAXPROCS(runtime.NumCPU())

	app.Start()
}