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

2018-06-28 Thread Lennart Poettering
On Do, 28.06.18 20:23, Nikolaus Rath (nikol...@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
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


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

2018-06-28 Thread Nikolaus Rath
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

Thanks,
-Nikolaus

[1] https://github.com/libfuse/libfuse/blob/master/util/init_script

-- 
GPG Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F

 »Time flies like an arrow, fruit flies like a Banana.«
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel