1
0

reload.go 388 B

1234567891011121314151617181920212223
  1. // +build !windows
  2. package daemon
  3. import (
  4. "github.com/cnlh/nps/lib/common"
  5. "github.com/cnlh/nps/vender/github.com/astaxie/beego"
  6. "os"
  7. "os/signal"
  8. "path/filepath"
  9. "syscall"
  10. )
  11. func init() {
  12. s := make(chan os.Signal, 1)
  13. signal.Notify(s, syscall.SIGUSR1)
  14. go func() {
  15. for {
  16. <-s
  17. beego.LoadAppConfig("ini", filepath.Join(common.GetRunPath(), "conf", "nps.conf"))
  18. }
  19. }()
  20. }