udev setup for custom rules

I’m running a containerized setup on Balena and am trying to apply a custom udev rule to create a symlink for a USB device, but I keep running into issues.

I need to use a custom udev rule to create a symlink (e.g., /dev/custom_device) for a USB device (ttyUSB0)

my_service:
  image: myimage/my-service:latest
  privileged: true
  network_mode: host
  ipc: host
  pid: host
  environment:
    - ROS_DOMAIN_ID=8
    - UDEV=1 (tried UDEV=on as well, not sure which I should use)
  command: sleep infinity

I also added ENV UDEV=on to my docker file

FROM balenalib/amd64-ubuntu:jammy
ENV UDEV=1 (tried on here too)

I’ve added a custom udev rule (/etc/udev/rules.d/90-custom.rules) with the following content:

KERNEL=="ttyUSB*", ATTRS{idVendor}=="0403", ATTRS{idProduct}=="6014", GROUP="dialout", MODE:="0666", SYMLINK+="custom_device"

the issue is that it doesnt show up as “/dev/custom_device”. When I try

udevadm control --reload-rules && udevadm trigger

I get

Running in chroot, ignoring request.

I took a break from this project but this was working before, even without using ENV UDEV in the docker or compose file. What’s the current right way of configuring udev rules?

pid: host doesn’t seem to work with udev, ipc: host also has some issues…

removing UDEV=on from the docker and compose file and adding

/lib/systemd/systemd-udevd --daemon && udevadm trigger

to the ENTRYPOINT works

1 Like

Hello @pateco thanks for sharing that removing UDEV=on and adding that to the entrypoint it works.

Let me share internally with the team to try to give you more insights! In the other hand, feel free to use Zendesk for support if you want!