[systemd-devel] Unit configuration for FUSE file system

Nikolaus Rath Nikolaus at rath.org
Wed May 2 13:08:04 PDT 2012


On 05/02/2012 03:53 PM, Lennart Poettering wrote:
> On Sat, 28.04.12 20:41, Nikolaus Rath (Nikolaus at rath.org) wrote:
> 
>> Hello,
>>
>> I am struggling to come up with the correct way to define a unit
>> configuration for a FUSE based network file system.
>>
>> Generally, the file system needs to be mounted and unmounted with its
>> own programs (rather than with mount and umount). The main reason for
>> the custom umount command, however, is that it uses some /proc based
>> hacks to block until the mount process has actually exited (this may
>> take quite some time even after the mountpoint has been freed, because
>> cached data is may still be transferred over the network).
>>
>> Things I am confused about:
>>
>> Is there a way to express this in a .mount unit, or do I need to declare
>> this as a more general .service?
>>
>> Is the custom umount command still necessary, or can I use the standard
>> umount() and rely on systemd to wait until the mount process has truly
>> finished before considering the service stopped?
>>
>> When using a .service file instead, is there some way to still tell
>> systemd that this service mounts a specific path?
> 
> The official API to mount file systems of any kind on Linux is
> /bin/mount. Only that makes sure we don't have to add additional hooks
> to various components of our stack to support specific file system
> types. It also makes sure that fstab works for this service the way it
> should. /bin/mount is capable of invoking helper tools for specific file
> systems, via a hook tool /sbin/mount.<fstype>.
> 
> Please make sure that your FUSE file system implements this mount
> extension protocol correctly. If it does, systemd will support it
> automatically, without any manual kludges. We won't support any other
> hacks in systemd. Sorry.


Ah, ok. Mounting with /bin/mount -t <myfusefs> works just fine, so I
should be good on that side. What I'm worried about is unmounting. The
file system can be unmounted with "umount /mntpoint", but when this
command returns, the mount helper that was started by /bin/mount is
still running and doing important things. Will systemd notice this and
act accordingly (e.g., wait for this process to terminate before
stopping the network)?


Thanks,

   -Nikolaus

-- 
 »Time flies like an arrow, fruit flies like a Banana.«

  PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6  02CF A9AD B7F8 AE4E 425C


More information about the systemd-devel mailing list