Exemple #1
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)
	}
}
Exemple #2
0
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()
}
Exemple #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()
}
Exemple #4
0
func stop(arg interface{}) {
	app := specs.NewProcess(pidfile, []specs.Module{specs.Module(&ct)})
	if err := app.Kill(syscall.SIGTERM); err != nil {
		glog.Fatal(err)
	}
}