+ killed := make(chan os.Signal, 0)
+ signal.Notify(killed, syscall.SIGHUP, syscall.SIGINT, syscall.SIGTERM)
+ go func() {
+ <-killed
+ trace(CDebug, "[%s] killed", BuildUUID)
+ jsReleaseAll()
+ RunningProcsM.Lock()
+ for pid, proc := range RunningProcs {
+ trace(CDebug, "[%s] killing child %d", BuildUUID, pid)
+ proc.Signal(syscall.SIGTERM)
+ }
+ os.Exit(1)
+ }()
+