Re: hotplug script before udev
On 3/8/06, David Berg <drberg1000@gmail.com> wrote:
> I'm trying to automount my digital camera (mass storage) when it is
> connected. I have udev scripts to give me a /dev/camera symlink which
> appears to be working, and created a map in hotplug to call a script
> called photodl which seems to be getting called.
>
> The problem is that photodl is called before the device is created from udev.
>
> dberg@chip:/var/log$ tail daemon.log
> Mar 8 11:01:00 localhost udev[7397]: configured rule in
> '/etc/udev/rules.d/10-local.rules[1]' applied, 'sdd1' becomes '%k'
> Mar 8 11:01:00 localhost udev[7397]: creating device node '/dev/sdd1'
> dberg@chip:/var/log$ tail messages
> Mar 8 11:00:54 localhost kernel: sdd: assuming Write Enabled
> Mar 8 11:00:54 localhost kernel: /dev/scsi/host6/bus0/target0/lun3: p1
> Mar 8 11:00:54 localhost kernel: Attached scsi removable disk sdd at
> scsi6, channel 0, id 0, lun 3
> Mar 8 11:00:55 localhost scsi.agent[7300]: sd_mod: loaded
> sucessfully (for disk)
> Mar 8 11:00:55 localhost scsi.agent[7332]: sd_mod: loaded
> sucessfully (for disk)
> Mar 8 11:00:55 localhost scsi.agent[7349]: sd_mod: loaded
> sucessfully (for disk)
> Mar 8 11:00:55 localhost usb.agent[7311]: usb-storage: already loaded
> Mar 8 11:00:55 localhost usb.agent[7311]: photodl: loaded successfully
>
>
> Note that photodl is "loaded successfuly" at 11:00:55 and my rule in
> 10-local.rules is applied at 11:01:00. 5 seconds later. I've added a
> `sleep 10` command before the mount command in photodl but that didn't
> help.
Part of the problem might be that nothing in my photodl script is
being run. Contents of script:
dberg@chip:/etc/hotplug$ cat photodl
#!/bin/bash
msg "photodl: starting/sleeping"
sleep 30
msg "photodl: mounting"
mount /media/camera
msg "photodl: ending"
dberg@chip:/etc/hotplug$ grep "photodl: starting" /var/log/*
returns nothing
I'm stumped.
--Dave
Reply to: