Skip to content

Commit 0c6ddc5

Browse files
committed
Fix: Signal parent once child takes over
1 parent ae5bfc8 commit 0c6ddc5

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

main.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,9 @@ func main() {
191191
kill(os.Getpid(), syscall.SIGUSR1)
192192
wg.Wait()
193193
defer ctx.Release()
194+
195+
// Signal parent process since we are taking over
196+
_ = kill(os.Getppid(), syscall.SIGUSR1)
194197
}
195198

196199
} else {
@@ -206,15 +209,9 @@ func main() {
206209
flags)
207210

208211
if err != nil {
209-
if !flags.Foreground {
210-
kill(os.Getppid(), syscall.SIGUSR2)
211-
}
212212
log.Fatalf("Mounting file system: %v", err)
213213
// fatal also terminates itself
214214
} else {
215-
if !flags.Foreground {
216-
kill(os.Getppid(), syscall.SIGUSR1)
217-
}
218215
log.Println("File system has been successfully mounted.")
219216
// Let the user unmount with Ctrl-C
220217
// (SIGINT). But if cache is on, catfs will

0 commit comments

Comments
 (0)