Skip to content

Commit cf83a61

Browse files
committed
Fix #230: Signal parent once child takes over
1 parent 350ff31 commit cf83a61

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

Diff for: main.go

+3-6
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,9 @@ func main() {
196196
kill(os.Getpid(), syscall.SIGUSR1)
197197
wg.Wait()
198198
defer ctx.Release()
199+
200+
// Signal parent process since we are taking over
201+
_ = kill(os.Getppid(), syscall.SIGUSR1)
199202
}
200203

201204
} else {
@@ -211,15 +214,9 @@ func main() {
211214
flags)
212215

213216
if err != nil {
214-
if !flags.Foreground {
215-
kill(os.Getppid(), syscall.SIGUSR2)
216-
}
217217
log.Fatalf("Mounting file system: %v", err)
218218
// fatal also terminates itself
219219
} else {
220-
if !flags.Foreground {
221-
kill(os.Getppid(), syscall.SIGUSR1)
222-
}
223220
log.Println("File system has been successfully mounted.")
224221
// Let the user unmount with Ctrl-C
225222
// (SIGINT). But if cache is on, catfs will

0 commit comments

Comments
 (0)