I have a Raspberry Pi 3 model B.
I installed Raspbian using NOOBS, and it worked great. I had a project that needed to execute certain actions when a USB device was connected. I learned about udev, and implemented some actions which worked neatly.
However, I had to change the SD card because the first one got corrupted. I repeated all the steps, and installed NOOBS again in my new SD card. Then, when I started working on udev rules, they didn't work anymore. Yep, using a completely fresh install.
No matter if the rule is calling a script in a file, or it's inlined, it always throws this error: Process 'x' failed with exit code 2., when I look at the udev service log, using systemctl status udev
I already tried to purge and install udev via apt-get. I also updated the packages.
My commands are as simple as this one:
ACTION=="add", SUBSYSTEM=="usb", RUN+="mkdir /home/pi/kamsdkamsdkasmd"
But even this one inlined throws the same error. Already tried using RUN= instead of RUN+= and using sudo, but it's the same.
Could anyone please help me? I already googled a lot, and couldn't find anything similar to my actual problem.
EDIT: tlhIngan, I downloaded NOOBS v2.4.4 in September. I used it for installing Raspbian the first time back in mid-September, and used exactly the same file (still downloaded to my PC, not downloaded again) to install it again yesterday after my first SD card got corrupted.
Right now I'm installing the lite version to a new SD Card, just to see if the problem persists. Thanks for asking.
EDIT 2: I installed Raspbian in two more SD cards, and both have exactly the same problem I described when starting using udev (fresh install, straight to adding my simple rule for testing the creation of a directory when plugging a USB device). No matter what I put in "RUN+=" or "RUN=", I get "Process 'command' failed with exit code 2.". I googled about udev and about its exit codes, and there's nothing to guide me from just that.
I checked the /var/log/messages
file for reading the logs made by devices being connected, and there's my device being recognized as it should. I also tested with 4 more USB cables (2 brand new), incase there was something wrong with the USB connection. I get the same error every single time.
So, I understand the problem occurs when running the script, and not when recognizing the device. I'm already losing my mind, because I don't know what could possibly be wrong. Please, help...