LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices

Reply
 
Search this Thread
Old 06-20-2007, 01:59 AM   #1
zoobave
LQ Newbie
 
Registered: Jun 2007
Posts: 20

Rep: Reputation: 0
Arrow Udev Rules - reg


hi,

I am in a situation that, i need to run a program (or Application) whenever an USB device is inserted. So that, i put the following entry in "/etc/udev/rules.d/01-local.rules" file.

SUBSYSTEM=="usb_device", ACTION=="add", ATTRS{manufacturer}=="JetFlash", PROGRAM="/usr/bin/nautilus ", NAME="%c", MODE="0777"



if i test using then following command, the nautilus starts

dvm@dvm-desktop:~$ udevtest /sys/class/usb_device/usbdev4.5/


parse_file: reading '/etc/udev/rules.d/00- init.rules' as rules file
parse_file: reading '/etc/udev/rules.d/01-local.rules' as rules file
parse_file: reading '/etc/udev/rules.d/05-options.rules' as rules file
parse_file: reading '/etc/udev/rules.d/10- myrule.rules' as rules file
parse_file: reading '/etc/udev/rules.d/20-names.rules' as rules file
parse_file: reading '/etc/udev/rules.d/25-dmsetup.rules' as rules file
parse_file: reading '/etc/udev/rules.d/25- iftab.rules' as rules file
parse_file: reading '/etc/udev/rules.d/30-cdrom_id
.rules' as rules file
parse_file: reading '/etc/udev/rules.d/40-permissions.rules' as rules file
parse_file: reading '/etc/udev/rules.d/45- fuse.rules' as rules file
parse_file: reading '/etc/udev/rules.d/45-hplip.rules' as rules file
parse_file: reading '/etc/udev/rules.d/45-libgphoto2.rules' as rules file
parse_file: reading '/etc/udev/rules.d/45- libsane.rules' as rules file
parse_file: reading '/etc/udev/rules.d/50-xserver-xorg-input-wacom.rules' as rules file
parse_file: reading '/etc/udev/rules.d/60-libpisock.rules' as rules file
parse_file: reading '/etc/udev/rules.d/60- symlinks.rules' as rules file
parse_file: reading '/etc/udev/rules.d/65-persistent-input.rules' as rules file
parse_file: reading '/etc/udev/rules.d/65-persistent-storage.rules' as rules file
parse_file: reading '/etc/udev/rules.d/80-programs.rules' as rules file
parse_file: reading '/etc/udev/rules.d/85-alsa.rules' as rules file
parse_file: reading '/etc/udev/rules.d/85-brltty.rules ' as rules file
parse_file: reading '/etc/udev/rules.d/85-hdparm.rules' as rules file
parse_file: reading '/etc/udev/rules.d/85-hplj10xx.rules' as rules file
parse_file: reading '/etc/udev/rules.d/85-hwclock.rules ' as rules file
parse_file: reading '/etc/udev/rules.d/85-ifupdown.rules' as rules file
parse_file: reading '/etc/udev/rules.d/85-pcmcia.rules' as rules file
parse_file: reading '/etc/udev/rules.d/90- modprobe.rules' as rules file
parse_file: reading '/etc/udev/rules.d/95-hal.rules' as rules file
parse_file: reading '/etc/udev/rules.d/99-udevmonitor.rules' as rules file
This program is for debugging only, it does not run any program,
specified by a RUN key. It may show incorrect results, if rules
match against subsystem specfic kernel event variables.

main: looking at device '/class/usb_device/usbdev4.5' from subsystem 'usb_device'
run_program: '/usr/bin/nautilus '
run_program: '/usr/bin/nautilus' returned with status 0

udev_rules_get_name: rule applied, 'usbdev4.5' becomes ''
run_program: 'usb_device_name --export usbdev4.5'
run_program: '/lib/udev/usb_device_name' (stdout) 'USB_BUS=004'
run_program: '/lib/udev/usb_device_name' (stdout) 'USB_DEV=005'
run_program: '/lib/udev/usb_device_name' returned with status 0
run_program: 'check_ptp_camera 06/01/01'
run_program: '/lib/udev/check_ptp_camera' returned with status 1
udev_device_event: device node creation supressed
main: run: 'socket:/org/freedesktop/hal/udev_event'
main: run: 'socket:/org/kernel/udev/monitor'





but, when i insert the same device, it will not run the program automatically. How can i modify the above entry to run the nautilus (or any program) automatically?

Is there anything i have to do after the changes to the file?

--

Regards,

Zoobave A
http://zoobave.blogspot.com/
 
Old 06-20-2007, 07:41 AM   #2
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 52
At least you need to restart udevd so that rules are parsed again.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Udev rules and Palm greatgoogamooga Linux - Software 6 11-29-2006 04:21 PM
writing udev rules doralsoral Linux - Software 10 11-19-2006 02:45 AM
udev rules Slackware 11 swampdog2002 Slackware 9 11-17-2006 07:06 PM
slackware-current, udev 0.96, and custom udev rules not working rignes Slackware 6 08-10-2006 03:43 AM
need help fixing my udev rules or ivman rules hedpe Linux - Hardware 2 03-18-2006 10:07 AM


All times are GMT -5. The time now is 06:32 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration