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

Re: udev rule for a kindle



On Fri, 13 Dec 2013 02:02:06 +1100
Scott Ferguson <scott.ferguson.debian.user@gmail.com> wrote:

> 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.
> 
Following on from your actions listed -
sudo leafpad /etc/udev/rules.d/85-kindle.rules
#again, one long line
ACTION=="add", SYSFS{idVendor}=="1949", SYSFS{idProduct}=="0004",
RUN+="/home/boudiccas/bin/obkindle" 
sudo udevadm control --reload-rules 
#plug in kindle, and mount by hand in thunar
sudo grep Kindle /var/log/syslog
Dec 12 16:21:29 london kernel: [200220.440937] usb 1-2.4.1: Product:
Amazon Kindle 
Dec 12 16:21:30 london kernel: [200221.455151] scsi
25:0:0:0: Direct-Access     Kindle   Internal Storage 0100 PQ: 0 ANSI:2 
Dec 12 16:21:43 london udisksd[5448]: Mounted /dev/sde1
at /media/boudiccas/Kindle on behalf of uid 1000 
#just on the off chance
sudo grep kindle /var/log/syslog
#returns zero, no output at all, it *has* to be 'Kindle'

It accepts 'SYSFS' or 'ATTR', no difference, and accepts *either* rule.
But still does not run the script. 

This is on a up-to-date 'jessie' system, with a basic Kindle (costing
£69 from Amazon, the basic model). Just so that we can perhaps see the
differences between our two systems. 

I attach a screenshot showing the kindle open in thunar. You'll see I
have 3 external usb drives, and thinking about it, they *all* have to
be mounted by hand, so the problem is not just with the kindle, its
system-wide. 'thunar-volman' is loaded, but I still have to mount by
hand, whichever file manager I use. 

ps aux|grep udevd
root       367  0.0  0.0  11796  1720 ?        Ss   Dec10   0:01 udevd
--daemon 
boudicc+ 12207  0.0  0.0   4208   804 pts/10   S+   16:45 0:00 grep
--color=auto udevd

Just to check one commonality, udevd is running. 
udev 204-5 from http://mirror.bytemark.co.uk/debian/ jessie/main i386
Packages

I've tried to find any and all commonalities between our two systems,
because they seem to be handling the same information in two different
ways!

Active kernel = 3.11-2-686-pae

Are we any further forward though? I'm not sure, so, any ideas please?

Thanks
Sharon.
-- 
A taste of linux = http://www.sharons.org.uk
efever = http://www.efever.blogspot.com/
efever = http://sharon04.livejournal.com/
my git repo = https://bitbucket.org/boudiccas/dots
Debian testing, Fluxbox 1.3.5, LibreOffice 4.1.3.2
Registered Linux user 561944

Attachment: Kindle - File Manager_011.jpg
Description: JPEG image

Attachment: signature.asc
Description: PGP signature


Reply to: