#1117776 nut: postinst fails in LXD container due to udevadm trigger permission

Package:
nut
Source:
nut
Submitter:
Michael Hatzlhoffer
Date:
2026-09-10 07:18:07 UTC
Severity:
normal
#1117776#5
Date:
2025-10-10 16:24:06 UTC
From:
To:
Dear Maintainer,

during installation of nut in an LXD container, the postinst script
fails at this line:

     [ -x /etc/init.d/udev ] && pidof systemd-udevd > /dev/null \
       && udevadm trigger --subsystem-match=usb --action=change

The container lacks permission to trigger USB changes via udevadm,
causing postinst to fail, although the rest of NUT works.

Steps to reproduce:

1. Launch a Debian container:
    lxc launch images:debian/12 mynut
2. Install nut:
    lxc exec mynut -- apt update
    lxc exec mynut -- apt install nut
3. Observe postinst failure.

Suggested fix: Skip udevadm trigger if running inside a container or
without sufficient privileges. Possibly check with
systemd-detect-virt --container.