Exemple #1
0
func stopServerAction(c *cli.Context) {
	pid, errRead := utils.ReadPidfile(SERVER_PIDFILE)
	if errRead != nil {
		fmt.Println(errRead.Error())
		os.Exit(1)
	}

	errKill := syscall.Kill(pid, syscall.SIGKILL)
	if errKill != nil {
		fmt.Println(errKill.Error())
		os.Exit(1)
	}

	// Kill gin
	if pid, err := utils.ReadPidfile(GIN_PIDFILE); err == nil {
		syscall.Kill(pid, syscall.SIGKILL)
	}
}
Exemple #2
0
func restartServerAction(c *cli.Context) {
	pid, errRead := utils.ReadPidfile(SERVER_PIDFILE)
	if errRead != nil {
		fmt.Println(errRead.Error())
		os.Exit(1)
	}

	errKill := syscall.Kill(pid, syscall.SIGUSR2)
	if errKill != nil {
		fmt.Println(errKill.Error())
		os.Exit(1)
	}
}