You are not logged in.

#1 2023-09-27 03:44:40

Frontear
Member
Registered: 2023-05-22
Posts: 29

[SOLVED] where should I use tmpfiles.d over udev rules.d?

Hi, bit of a different question this time around. Been doing some tinkering and for a while I was using a udev rule to change my backlight permissions to accept "wheel" modifications, allowing me to directly manipulate the backlight values. For a while, I thought this was the ideal solution, udev is pulled from systemd so it's extra-dependency free, but now I came across tmpfiles.d from systemd as well. From a quick glance, it seems to allow a value of things, writing and modifying permissions, which is actually what I've been udev for. I know udev has a lot more power than just permissions, so I wonder if its more appropriate for my use-case to keep these sorts of things on tmpfiles vs udev.

Basically, I'm just trying to understand the semantics of a tmpfile vs a udev rule. Is one semantically more correct? Am I using tmpfiles correctly, or am I misunderstanding what it's designed for?

Last edited by Frontear (2023-09-27 13:24:40)

Offline

#2 2023-09-27 07:28:59

seth
Member
Registered: 2012-09-03
Posts: 59,882

Re: [SOLVED] where should I use tmpfiles.d over udev rules.d?

udev responds to HW events, tmpfiles unconditionally tinkers with the filesystem.
You can probably use the latter to alter permissions of a device node that is present in a static location before tmpfiles acts, but it won't help you creating a symlink for a device node that shows up in a random location somewhen during runtime when you plug some usb dongle.

Offline

#3 2023-09-27 13:24:22

Frontear
Member
Registered: 2023-05-22
Posts: 29

Re: [SOLVED] where should I use tmpfiles.d over udev rules.d?

seth wrote:

udev responds to HW events, tmpfiles unconditionally tinkers with the filesystem.
You can probably use the latter to alter permissions of a device node that is present in a static location before tmpfiles acts, but it won't help you creating a symlink for a device node that shows up in a random location somewhen during runtime when you plug some usb dongle.

Right good point, tmpfiles wouldn't be able to "react" to new devices or files the way udev could. That's a good thing to consider for sure

Offline

Board footer

Powered by FluxBB