check to see if backend server dies
Ted Unangst tedu@tedunangst.com
Mon, 27 Apr 2020 21:14:05 -0400
2 files changed,
4 insertions(+),
2 deletions(-)
M
backend.go
→
backend.go
@@ -100,7 +100,7 @@ }
srv.Accept(lis) } -func startBackendServer() { +func runBackendServer() { proc := exec.Command(os.Args[0], "-datadir", dataDir, "backend") proc.Stdout = os.Stdout proc.Stderr = os.Stderr@@ -108,4 +108,6 @@ err := proc.Start()
if err != nil { log.Panicf("can't exec backend: %s", err) } + err = proc.Wait() + log.Panicf("lost the backend: %s", err) }