Up to now I used this line in /etc/fstab:

/home/ftp_user /home/app_user/mounts/ftp_user  fuse.bindfs  mirror=app_user 0    0

This works. The app_user can access the files of ftp_user like if the files would be his own files.

Now I would like to use inotify. The app_user listens for changes in the bind-mounted directory.

It works if app_user touches a file in /home/app_user/mounts/ftp_user.

But it does not work, if ftp_user touches a file in /home/ftp_user.

Is there way to get this working?

OS: Linux only.

  • Use ACLs, not FUSE bindfs. There's no need for a bind mount at all. – Michael Hampton Oct 8 '18 at 19:13

What you are trying to achieve can't be done.
Look at the https://bindfs.org/ and scroll down to "Known issues" section. You will see that

inotify events are not triggered since FUSE doesn’t provide an API for this

You can use inotify to monitor /home/ftp_user, but in this case user who is setting up watch will need to have access to this directory.

  • Maybe there is a solution which does not use FUSE? – guettli Oct 8 '18 at 15:42
  • 2
    You can possibly use ACL and add permissions to user app_user on /home/ftp_user dir and then setup inotify watch directly to /home/ftp_user dir. That of course would require mounting /home file system with ACL option. – Dmitry Zayats Oct 8 '18 at 15:45
  • 1
    Solution which does not use fuse is called ACL - Access Control Lists. Start reading here access.redhat.com/documentation/en-us/red_hat_enterprise_linux/… – Dmitry Zayats Oct 8 '18 at 15:47

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.