Skip to content

Commit

Permalink
Fix: Signal parent once child takes over
Browse files Browse the repository at this point in the history
  • Loading branch information
voyvodov committed Sep 13, 2024
1 parent 14d6248 commit fbcccc6
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,9 @@ func main() {
kill(os.Getpid(), syscall.SIGUSR1)
wg.Wait()
defer ctx.Release()

// Signal parent process since we are taking over
_ = kill(os.Getppid(), syscall.SIGUSR1)
}

} else {
Expand All @@ -211,15 +214,9 @@ func main() {
flags)

if err != nil {
if !flags.Foreground {
kill(os.Getppid(), syscall.SIGUSR2)
}
log.Fatalf("Mounting file system: %v", err)
// fatal also terminates itself
} else {
if !flags.Foreground {
kill(os.Getppid(), syscall.SIGUSR1)
}
log.Println("File system has been successfully mounted.")
// Let the user unmount with Ctrl-C
// (SIGINT). But if cache is on, catfs will
Expand Down

0 comments on commit fbcccc6

Please sign in to comment.