From fbcccc6f60c9eaabd98cce605e90aea708442232 Mon Sep 17 00:00:00 2001 From: Hristo Voyvodov Date: Fri, 13 Sep 2024 14:00:59 +0300 Subject: [PATCH] Fix: Signal parent once child takes over --- main.go | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/main.go b/main.go index 112b8595..16750f56 100644 --- a/main.go +++ b/main.go @@ -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 { @@ -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