Skip to content

Commit

Permalink
Improve kernel startup error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
quentinguidee committed Sep 26, 2023
1 parent ab31fba commit bb4bb32
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions kernel/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ func main() {
err := r.Start()
if err != nil {
log.Error(err)
return
}
shutdownChan <- syscall.SIGINT
}()
Expand All @@ -37,11 +36,15 @@ func main() {
u := getUnprivilegedUser()
var err error
vertex, err = runVertex(u)
vertex.Wait()
if err != nil {
log.Error(err)
shutdownChan <- syscall.SIGINT
return
}
err = vertex.Wait()
if err != nil {
log.Error(err)
}
shutdownChan <- syscall.SIGINT
}()

Expand All @@ -50,9 +53,9 @@ func main() {

<-shutdownChan
log.Info("Shutting down...")
r.Stop()
_ = r.Stop()
if vertex != nil && vertex.Process != nil {
vertex.Process.Kill()
_ = vertex.Process.Kill()
}
}

Expand Down

0 comments on commit bb4bb32

Please sign in to comment.