diff --git a/backend.go b/backend.go index 8ad3117..a4800bc 100644 --- a/backend.go +++ b/backend.go @@ -100,7 +100,7 @@ func backendServer() { 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 @@ func startBackendServer() { if err != nil { log.Panicf("can't exec backend: %s", err) } + err = proc.Wait() + log.Panicf("lost the backend: %s", err) } diff --git a/web.go b/web.go index 7459c7a..5a985e0 100644 --- a/web.go +++ b/web.go @@ -2325,7 +2325,7 @@ func serve() { if err != nil { log.Fatal(err) } - startBackendServer() + go runBackendServer() go enditall() go redeliverator() go tracker()