gocryptfs
gocryptfs copied to clipboard
Logger process gets killed by xfce4-terminal
When mounting with the following command line (Arch linux, latest version 2.2.1 from the standard Arch repo) the process list shows a zombie logger (screenshot)
cat "$KEY_FILE" | gocryptfs -nonempty -masterkey stdin "$VOLUME_PATH" "$ACCESS_DIR"
The mount seems to be fully operational.
$ gocryptfs -version
gocryptfs v2.2.1; go-fuse [vendored]; 2022-04-27 go1.18.1 linux/amd64
$ uname -a
Linux host_name 5.17.9-arch1-1 #1 SMP PREEMPT Wed, 18 May 2022 17:30:11 +0000 x86_64 GNU/Linux
$ go version
go version go1.18.2 linux/amd64
I do not manually specify neither "-fg" nor "-notifypid" options. BTW the process with "notifypid" PID does not exists.
Turns out this was a side-effect of running this in a spawned terminal as in xfce4-terminal -x {script to execute}
. The terminal apparently attempts to send HUP
signals to all direct and indirect children upon shutting itself down.
I changed the original line to
cat "$KEY_FILE" | nohup gocryptfs -nonempty -masterkey stdin "$VOLUME_PATH" "$ACCESS_DIR" >/dev/null 2>&1
and have no more zombies.
Now, I can't say whether this is still a bug of daemonizing of a process or just a peculiar detail of this specific implementation. I didn't see it anywhere in the gocryptfs
documentation about the need to use nohup
in order to daemonize it correctly. I am not closing this, leaving it on the owner's discretion.
I think this is a bug in gocryptfs. Daemonizing should put gocryptfs and also the logger process out of reach for xfce4-terminal.
PS: "-fg" and "-notifypid" get added during daemonizing. The process at "-notifypid" exits once daemonization is complete.