I have an executable compiled from my code. I am trying to run this executable when I insert a serial device into my Raspberry Pi Zero W using udev. However, for some reason the executable will not run, I have looked with top and there is no sign of the process.
Here my udev rules file in /etc/udev/rules.d/10-serial-usb.rules:
ACTION=="add", SUBSYSTEM=="usb", KERNEL=="1-1.3", ATTR{idProduct}=="7523", ATTR{idVendor}=="1a86", RUN="/bin/bash /home/blackbox/blackbox-cpp/run.sh"
And here is the bash script in /home/blackbox/blackbox-cpp/run.sh:
#!/bin/bash
/home/blackbox/blackbox-cpp/bin/blackbox &
The bash script definitely runs because I have used commands like mkdir and touch from the script to test that it is actually being run, and they each work correctly. So why is my executable different?
Let me clarify that by not working, I mean that the executable does not appear to be running with top.
RUN="/home/blackbox/blackbox-cpp/bin/blackbox"in theudevrule? Also,toponly shows the top processes by whatever you are sorting with, better to test withpgrep blackboxorps aux | grep blackbox./home/blackbox/blackbox-cpp/bin/blackbox 2>/tmp/blackbox.log 1>&2and then check the file/tmp/blackbox.logfor errors.