[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: udev rule for a kindle



On 13/12/13 01:30, Sharon Kimble wrote:
> On Thu, 12 Dec 2013 11:43:32 +1100
> Scott Ferguson <scott.ferguson.debian.user@gmail.com> wrote:
> 
>> On 12/12/13 01:01, Sharon Kimble wrote:
>>>
>>> I have a script for backing up my kindle when its first mounted,
>>> but its not running on mounting, but *does* run when invoked
>>> manually! When the kindle is mounted it should trigger this udev
>>> rule -
>>>
<snipped>
>>>
>>
>> Try (though I 'suspect" ACTION is unnecessary):-
>> ACTION=="add",SUBSYSTEM=="usb", ATTR{idVendor}=="1949",
>> ATTR{idProduct}=="0004", MODE="0666",
>> RUN+="/home/boudiccas/bin/obkindle"
> 
> This is /etc/udev/rules.d/85-kindle.rules as it is now -
> # saved to /etc/udev/rules.d/85-kindle.rules
> ACTION=="add", SYSFS{idVendor}=="1949", SYSFS{idProduct}=="0004",
> RUN+="/home/boudiccas/bin/obkindle" 
> #ACTION=="add", SUBSYSTEM=="usb",
> ATTR{idVendor}=="1949", ATTR{idProduct}=="0004", MODE="0666",
> RUN+="/home/boudiccas/bin/obkindle"
> Just two long lines, but the first line, #2 is actually quicker at
> displaying the kindle than #3, and it still is not automounted. 



Neither version "displays" the Kindle on my systems. udisks does. Your
udev rule makes no difference here.

> 
> I've attached a file 'kindlemount.txt' which shows the output of '
> udevadm monitor --udev', 'sudo grep Kindle /var/log/syslog', and
> 'lsusb'. 


Thankyou.

>>
>> Look at:-
>> $ grep kindle /var/log/syslog
>> you'll probably find "unknown key 'SYSFS" and other useful hints
>> also "udevadm monitor --kernel" and "udevadm monitor --udev" will give
>> you some real-time info about udev.
> 
> Theres no difference in the syslog whether I run with 'SYSFS' or
> 'ATTR', neither show up specifically


Does on my system:-

# nano /etc/udev/rules.d/85-kindle.rules
# cat /etc/udev/rules.d/85-kindle.rules
# one long line
ACTION=="add", SYSFS{idVendor}=="1949", SYSFS{idProduct}=="0004",
RUN+="/home/scott/kindle.sh"
# udevadm control --reload-rules
[plugs in Kindle]
#  grep kindle /var/log/syslog
Dec 13 01:40:59 vbserver udevd[5775]: unknown key 'SYSFS{idVendor}' in
/etc/udev/rules.d/85-kindle.rules:1
Dec 13 01:40:59 vbserver udevd[5775]: invalid rule
'/etc/udev/rules.d/85-kindle.rules:1'
[removes kindle]
# nano /etc/udev/rules.d/85-kindle.rules
# cat /etc/udev/rules.d/85-kindle.rules
#ACTION=="add",
# note that only ACTION is commented out, you'd commented out the whole
string. Uncommenting it makes no difference in my test.
SUBSYSTEM=="usb",ATTR{idVendor}=="1949", ATTR{idProduct}=="0004",
MODE="0666", RUN+="/home/scott/kindle.sh
# udevadm control --reload-rules
[plugs in Kindle]
#  grep kindle /var/log/syslog
Dec 13 01:40:59 vbserver udevd[5775]: unknown key 'SYSFS{idVendor}' in
/etc/udev/rules.d/85-kindle.rules:1
Dec 13 01:40:59 vbserver udevd[5775]: invalid rule
'/etc/udev/rules.d/85-kindle.rules:1'
[no new errors, but script *still* doesn't launch]


<snipped>

Sorry - no epiphanies. I'll have another think about it in the morning.


Kind regards.


Reply to: