bindfs icon indicating copy to clipboard operation
bindfs copied to clipboard

macos: Provide Launch Agent to mount bindfs on system startup

Open Kentzo opened this issue 2 years ago • 4 comments

With https://github.com/mpartel/bindfs/pull/140 merged, it's now possible to use /etc/fstab to declare bindfs file systems and /sbin/mount to mount them.

It should now be possible to provide a Launch Agent that could run at startup as well as watch for changes in /etc/fstab and issue /sbin/mount -a -t bindfs to automatically mount bindfs filesystems declared with the auto option in the fourth field.

Would you be interested in this contribution?

Kentzo avatar Sep 22 '23 15:09 Kentzo

Sure! I'm a little surprised MacOS doesn't mount all auto filesystems by default.

mpartel avatar Sep 22 '23 16:09 mpartel

It does, but the builtin behavior is convoluted. There is autofs and then there is diskarbitrationd. Neither is suitable to mount arbitrary auto file systems from /etc/fstab.

  • autofs only supports filesystems that provide /sbin/mount_*. Since /sbin, for all intents and purposes, is a protected directory, thus you're pretty much limited to builtin filesystems. Moreover the tool is designed to handle network filesystems.
  • diskarbitrationd respects /etc/fstab, but has custom interpretation of the auto option. Since it only mounts in response to hardware-related IPC events (such as attachment of a USB device), auto determines whether newly available file system needs to be automatically mounted.

Kentzo avatar Sep 22 '23 16:09 Kentzo

Would you consider obtaining signing certificate from Apple?

I want to contribute a script to create a pkg installer with binaries for macOS.

Kentzo avatar Sep 23 '23 15:09 Kentzo

I'm not an active Mac user, and I've wasted enough of my life fighting Apple's, let's say, "automation-resistant" signing infrastructure at work, so I'd prefer not to. But if you'd like to maintain some binaries yourself, I'm happy to link to them.

mpartel avatar Sep 23 '23 16:09 mpartel