HenrikBengtsson / easycatfs

easycatfs - Easy Mounting of Slow Folders onto Local Disk
https://github.com/HenrikBengtsson/easycatfs
3 stars 0 forks source link

ROBUSTNESS: Automatic unmount when shell terminates #16

Open HenrikBengtsson opened 2 years ago

HenrikBengtsson commented 2 years ago

Wish

In order to avoid catfs mounts being left behind, can we make it so that catfs mounts are automatically unmounted when the shell terminates, e.g.

[alice@dev2 ~] data=$(easycatfs mount "$PWD/data")
[alice@dev2 ~] doing_stuff
[alice@dev2 ~] more_stuff
[alice@dev2 ~] exit
Unmounting all easycatfs mounts ...
Cache summary:
/wynton/home/boblab/alice/repositories/easycatfs/data: 1073742080 bytes
Total: 1073742080 bytes
Unmounting all easycatfs mounts ... done

Possible solution

We could probably turn eastcatfs into a Bash function. Then it could modify the current shell process, automatically including injecting an EXIT trap.