[systemd-devel] creating device nodes

Richard Hector richard at walnut.gen.nz
Wed Apr 5 09:47:45 UTC 2023


Great, thanks - that seems to work:
/etc/tmpfiles.d/fuse.conf:

#Type Path       Mode User Group Age Argument
c!     /dev/fuse  0666 root root  -   10:229

Mind you, I'm not entirely clear on what the '!' is for; I just put it 
in because the manpage said it was a good idea :-)

Now to replicate that with ansible for my other containers ...

Cheers,
Richard

On 5/04/23 20:22, Mantas Mikulėnas wrote:
> .device units do not mknod, they only represent existing state.
> 
> /dev/fuse is usually created through tmpfiles.d (which gets its 
> configuration via kmod-static-nodes.service).
> 
> # kmod static-nodes --format=tmpfiles
> 
> On Wed, Apr 5, 2023 at 11:13 AM Richard Hector <richard at walnut.gen.nz 
> <mailto:richard at walnut.gen.nz>> wrote:
> 
>     Hi all,
> 
>     I want to create a device (/dev/fuse) in an LXC container. The kernel
>     bit works; I can mknod manually, but I'd rather use a systemd unit, and
>     make it a dependency of mounting filesystems from /etc/fstab.
> 
>     It looks like .device units are supposed to be created automatically if
>     there's an appropriate udev rule with TAG+="systemd" - these lines
>     exists in /usr/lib/udev/rules.d/99-systemd.rules:
> 
>     # Asynchronously mount file systems implemented by these modules as
>     soon
>     as they are loaded.
>     SUBSYSTEM=="module", KERNEL=="fuse", TAG+="systemd",
>     ENV{SYSTEMD_WANTS}+="sys-fs-fuse-connections.mount"
> 
>     The comment seems to suggest it will cause the filesystems to be
>     mounted
>     when the device is created, which is kind of the reverse of what I'm
>     after. Do I need a different line?
> 
>     Or do I need to create a .device unit file manually? I can't see much
>     info on doing that.
> 
>     Cheers,
>     Richard
> 
> 
> 
> -- 
> Mantas Mikulėnas



More information about the systemd-devel mailing list