mirror of
				https://github.com/ehang-io/nps
				synced 2025-10-30 15:26:58 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			25 lines
		
	
	
		
			362 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			362 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| // +build !windows
 | |
| 
 | |
| package daemon
 | |
| 
 | |
| import (
 | |
| 	"os"
 | |
| 	"os/signal"
 | |
| 	"path/filepath"
 | |
| 	"syscall"
 | |
| 
 | |
| 	"github.com/astaxie/beego"
 | |
| 	"github.com/cnlh/nps/lib/common"
 | |
| )
 | |
| 
 | |
| func init() {
 | |
| 	s := make(chan os.Signal, 1)
 | |
| 	signal.Notify(s, syscall.SIGUSR1)
 | |
| 	go func() {
 | |
| 		for {
 | |
| 			<-s
 | |
| 			beego.LoadAppConfig("ini", filepath.Join(common.GetRunPath(), "conf", "nps.conf"))
 | |
| 		}
 | |
| 	}()
 | |
| }
 | 
