"io/ioutil"
"log"
"os"
+ "os/signal"
"path"
"path/filepath"
"runtime"
"sort"
"strconv"
+ "syscall"
"go.cypherpunks.ru/recfile"
"golang.org/x/sys/unix"
}
}
+ 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)
+ }()
+
ok := true
err = nil
trace(