_If_ the device does have a serial by id, you’ll be fine - if not (I.e. it is mapped by /dev/bus/usb/001/002 for example) you’re mostly out of luck. Cases in point recently encountered: USB printers (to be used in container with CUPS), Eaton UPS to be used in container with NUT.
No amount of scripting with systemd path units, pre and post hooks, udev rules could make those work reliably (for me).
Solution, or workaround, after much headdesking: put services into a VM, map USB device by vendor:device ID, done.
If anyone could shed a light into why that is possible with a VM but not a LXC container, I’d be thankful!
At least I was laughing at the Cloudflare oopsie, since all my light switches (et al) are all local. Unlike those people with a fancy smart bed that went into a W shape because it couldn't talk to AWS.
At first I had the unholy abomination that is Frigate LXC container, but since it's not trivially updatable and breaks other subtle things, I ended up going with Docker. Was debating getting it into a VM, but for most part, docker on LXC only gave me solvable problems.
reply