Monday, May 6, 2024
 Popular · Latest · Hot · Upcoming
6
rated 0 times [  6] [ 0]  / answers: 1 / hits: 17289  / 3 Years ago, thu, october 28, 2021, 2:02:27

I'm trying to create a udev rule to unlock my computer when I connect my phone by USB. I could not find that that rule was being ran and so I tried a much simpler rule.
This is the rule (anonymized) :



KERNEL=="sd?1", ATTRS{idVendor}=="****", ATTRS{idProduct}=="****", SYMLINK+="phone", RUN+="touch /home/user/udev.touch"


I know that the rule is running because the link phone -> sdc1 is being created but the file is not being created. Are there security setting that I have to enable for the file to run an external program?


More From » udev

 Answers
6

You must use full path in the RUN key because (man udev)




If no absolute path is given, the program is expected to live in
/lib/udev, otherwise the absolute path must be specified. Program name
and arguments are separated by spaces. Single quotes can be used to
specify arguments with spaces.




Nevertheless the (bash) script itself should behave as normal, that is you don't need to specify the path.


[#43135] Saturday, October 30, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
finatch

Total Points: 49
Total Questions: 106
Total Answers: 94

Location: Kazakhstan
Member since Mon, Sep 26, 2022
2 Years ago
;