I have a couple of udev rules in a container that trigger when a USB storage device is inserted or removed (with a Raspberry Pi). The rules trigger correctly, and the relevant scripts are run.
Within the scripts, I want to call the Balena Supervisor API using curl, to restart an adjacent service. This call is not working.
- I determined that the
BALENA*environment variables are unavailable in the udev environment, and I fixed that (by caching them in files)
- The curl command runs correctly when called from a terminal in the container
- Presumably there is some other udev limitation that I’m not aware of? I tried adding
/lib/systemd/system/udev.service, but that’s not it; perhaps the Balena udev service is configured differently?