linux - udev rules not working -
I am using Ubuntu and when my USB stick is connected then I should have a date log. I have created
sudo vi /etc/udev/rules.d/60-my.rules
where
Sub == "USB", action == "add", kernel == "sd? 1", ATTRS {serial} == "11353000000006E5", run + = "/ usr / local / bin / myusbrule.sh / dev / Sdb1 "
Where there is a 11353000000006 E5 serial number my shell script of my pen drive is myusbrule.sh
#! / Bin / bash date & gt; & Gt; /home/nilesh/log.log
But when I am adding pen drive, nothing is being updated in the log file, am I wrong anywhere?
"itemprop =" text ">
udev can not run your script on any active terminal, and it is under the context of a shell It does not execute: you can not expect any standard output to appear on your terminal, you can try to write a log file or something like this.
Source:
Comments
Post a Comment