Re: [PATCH RFC 0/4] leds: extend disk trigger
From: Markus Probst
Date: Tue Sep 01 2026 - 19:01:27 EST
On Mon, 2026-01-26 at 10:19 -0600, Ian Pilcher wrote:
> On 1/26/26 3:00 AM, Niklas Cassel wrote:
> > But I'm not a fan of making the driver more complex.
> > If we want something more complex than what is already there, then it
> > is probably much better handled in user space, considering the amount
> > of possible configuration options.
> >
> > Basically the same argument as used in:
> > https://lore.kernel.org/linux-nvme/20220227234258.24619-1-ematsumiya@xxxxxxx/T/#u
>
> Niklas -
>
> Can you provide some links on how this might be done in userspace?
>
> I've been maintaining my out-of-tree block device trigger for years, to
> make the LEDs on my NAS work.
>
> https://github.com/ipilcher/ledtrig-blkdev/blob/v6.9%2B/drivers/leds/trigger/ledtrig-blkdev.c
>
> I'd love to be able to replace it with something in-tree.
(I left the mailing lists except dt in Cc, so others with the same
feature requirement can find this mail on the LKML).
Hi Ian,
In the case you are interested, I ended up writing a userspace daemon:
https://codeberg.org/0xIO32/statusd .
Also published as rust crate at https://crates.io/crates/statusd .
It has a bit more functionality, but for simple disk blinking a example
config would be:
```
disks:
# Any path that is a symlink to a block device works.
# Any component in the path can be a regex, so any special regex
characters must be escaped.
- path: '/dev/disk/by-path/pci-0000:02:00\.0-nvme-1'
present:
- led: disk1
priority: 10
mode: static
brightness: 255
io:
poll_interval: 100ms
# min_active_time: 300ms
activity:
- led: disk1
priority: 20
mode: blink
delay_on: 90
delay_off: 90
# read: [] (events in here trigger only with read activity)
# write: [] (events in here trigger only with write activity)
leds:
disk1:
name: multicolor:disk-1
default:
priority: 0
mode: static
brightness: 0
```
Config path: /etc/statusd.yaml
In this config, the led brightness is 255 if the disk is present, 0
otherwise. If there is read or write activity, it will blink with a
delay of 90 ms (brightness is unset, so it gets inherited from the
lower priority, resulting in 255).
Disk and Led Hotplugging is fine, but `ledtrig-timer` should be loaded
ahead of time or it might cause an error loop (statusd.service takes
care of that).
After the goals in the README are completed, I will try to get it
packaged into the debian repositories.
Thanks
- Markus Probst
Attachment:
signature.asc
Description: This is a digitally signed message part