[systemd-devel] What should mount /sys/fs/fuse/connections?

Lennart Poettering lennart at poettering.net
Thu Jun 28 20:15:07 UTC 2018


On Do, 28.06.18 20:23, Nikolaus Rath (Nikolaus at rath.org) wrote:

> Hello,
> 
> I'm maintainer of libfuse. libfuse ships with a SysV init script[1] that
> I'd like to replace with a systemd unit file. It currently does just two
> things:
> 
> 1. loads fuse kernel module
> 2. mounts fusectl filesystem at /sys/fs/fuse/connections
> 
> I don't think there is a need to retain the function to load the kernel
> module (that's probably better done by eg. /etc/modules), but I am not
> sure how to migrate the mounting of the control filesystem.
> 
> My gut feeling is that this should be done by udev in response to the
> fuse kernel module being loaded. Is that correct? If so, does libfuse
> need to install a systemd unit (or probably rather a udev rules file) in
> order for this to happen? Or should things just work(tm) nowadayS

systemd already contains a .mount unit for this
(sys-fs-fuse-connections.mount), which is pulled in automatically when
the kmod is loaded, see 99-systemd.rules. Hence you shouldn't need to
have any further script or such in place, it should already get
mounted out of the box.

Since the mount unit is activated asynchronously, there's a minor race
however, and services which want to access the mount point should
order themselves explicitly after the unit and pull it in, for example
through:

    Wants=sys-fs-fuse-connections.mount
    After=sys-fs-fuse-connections.mount

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list