python - fuse action on umount -


i've written simple filesystems python-fuse, i'm wanting can't find in pydoc nor in sample scripts i've found: when filesystem unmounted fusermount -u, want trap action, perform umount, , rmdir mount directory created program's initialization script. if possible, what's magic incantation trap umount action?

i can see how turn endless loop, can figure out how disable umount trap first time it's hit.


update: found destroy @ http://omake.metaprl.org/prerelease/omake-dll-fuse.html#htoc582 , added method, doesn't seem called.

found it! it's fsdestroy() in python-fuse. located by:

 jcomeau@intrepid:/usr/src/google-desktop/api$ cat /usr/lib/python2.6/dist-packages/fuseparts/* | strings | grep destroy fsdestroy 

what used was:

 def fsdestroy(self, data = none):   syslog.syslog(syslog.log_info, 'destroy %s: %s' % (self.mountpoint, data))   os.rmdir(self.mountpoint) 

don't know if data parameter necessary or not, doesn't hurt. , apparently, it's called after umount, didn't have worry handling that.


Comments