Run BindFS after filesystem mounted

Asked by Aaron Whitehouse

Hello,

I use BindFS so that multiple users on my machine can access the same shared folder without permissions issues (I was always surprised it was so difficult, but that's by the by). The guide that essentially sets out what I do is here (Method 1 - Fstab):
https://help.ubuntu.com/community/Bindfs-SharedDirectoryLocalUsers

I have recently rebuilt my machine and now I want the shared directory (/home/shared) to actually be on the spinning disk rather than the SSD. I can do this with:
bindfs -o perms=0700,mirror-only=aaron:user2 /media/spinning/shared /home/shared

If I put this into my /etc/fstab, however, it sometimes works and sometimes doesn't, so I suspect it is to do with whether /media/spinning is mounted before it tries to do the BindFS mount. I therefore want to run the command after the filesystem is mounted. The guide linked to above sets out how to do this as Method 2, but only using an Upstart job.

I tried to convert this to a systemd job, but it doesn't seem to be working:
/etc/systemd/system/mountbindfs.service
===
[Unit]
Description=Run BindFS so that both users can access folder
Requires=media-spinning.mount
After=media-spinning.mount

[Service]
Type=oneshot
ExecStart=/usr/bin/bindfs -o perms=0700,mirror-only=aaron:user2 /media/spinning/shared /home/shared

[Install]
WantedBy=multi-user.target
===

Can anybody suggest what I've done wrong?

Thanks!

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu systemd Edit question
Assignee:
No assignee Edit question
Solved by:
Aaron Whitehouse
Solved:
Last query:
Last reply:
Revision history for this message
Aaron Whitehouse (aaron-whitehouse) said :
#1

As explained here:
https://bbs.archlinux.org/viewtopic.php?id=175230
the "bindfs#" fstab method that is outlined on the help page is deprecated and not supported by the systemd mounter.

By changing my fstab to:
/media/spinning/shared /home/shared fuse.bindfs perms=0700,mirror-only=aaron:user2 0 0
this works as expected.

I will update the help page.

All that said, the page is missing a systemd script, given method 2 uses the now deprecated Upstart.

Revision history for this message
Sue Allen (sueallen) said :
#2

Hi, i'm using Kubuntu 15.04 beta 1 on kernel: Linux kubuntu 3.19.0-9-generic.

Today after the last system upgrades when I start the PC, it will boot but after the kubuntu splash image, when it has to start sddm, it turns completely white... https://happywheels2.io
Same thing if i use Upstart.

I'm on a XPS15 laptop with NVidia 540m and Intel i7...