[systemd-devel] [PATCH 2/2] tmpfiles: support globbing for w option
lennart at poettering.net
Mon Sep 10 15:42:24 PDT 2012
On Mon, 03.09.12 17:13, Dave Reisner (dreisner at archlinux.org) wrote:
> Break out the write logic into a separate function and simply use it as
> a callback to glob_item.
> This allows users to consolidate writes to sysfs with multiple similar
> pathnames, e.g.
> w /sys/class/block/sd[a-z]/queue/read_ahead_kb - - - - 1024
While I am not totally opposed to the patch I think it's the wrong
solution for this problem.
For this usecase you need to write an udev rule that applies this
settings as the device shows up. This is the only way to make this
race-free and ensure that this setting is also applied to all hard
drives plugged in later. The udev rule would be quite short I guess, but
of course a little bit less obvious, but that's something we could fight
with docs (for example, lennart doing a blog story about how to safely
write values to sysfs -- which coincidentally is already on the TODO
I'd really like to avoid that people end up using tmpfiles for things
like this, so I am leaning vaguely against merging this, but I could
convinced otherwise with another good usecase.
Lennart Poettering - Red Hat, Inc.
More information about the systemd-devel