LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-16-2013, 04:00 PM   #1
csegau
LQ Newbie
 
Registered: Oct 2009
Posts: 27

Rep: Reputation: 0
udev rule issue


Hi All,

I have written a rule as below.

SUBSYSTEM=="usb", ACTION=="add", RUN="/tmp/test.pl"

Problem 1:
when i connect USB device, i see that my script "/tmp/test.pl" is getting executed twice. (i observed this by logging message in log file)

Problem 2: I am trying to mount the USB device as i connect,by identifying device from "/proc/diskstats" o/p (last line has the device information)
and then try to mount it, i am doing this in "/tmp/test.pl" script

please help me.

Thanks in advance.
-csegau
 
Old 05-16-2013, 04:05 PM   #2
csegau
LQ Newbie
 
Registered: Oct 2009
Posts: 27

Original Poster
Rep: Reputation: 0
Hi All,

I have written a rule as below.

SUBSYSTEM=="usb", ACTION=="add", RUN="/tmp/test.pl"

Problem 1:
when i connect USB device, i see that my script "/tmp/test.pl" is getting executed twice. (i observed this by logging message in log file)

Problem 2: I am trying to mount the USB device when connected, from script '/tmp/test.pl" invoked from udev rule, by identifying device from "/proc/diskstats" o/p (last line has the device information). Even though /proc/diskstats list the new parition for example (/dev/sdd) and i mount it like "mount /dev/sdd /tmp/mnt" but it does not worked, i observed that "/dev/sdd" is not created till "/tmp/test.pl" script is finished execution.

please help me.

Thanks in advance.
-csegau
 
  


Reply



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
First UDEV Rule, Not quite there ... orbit Slackware 7 02-22-2009 10:08 PM
udev rule problem with 12.2 conundrum07 Slackware 8 01-04-2009 12:04 PM
udev rule: need help DPenguin Linux - Hardware 0 08-04-2008 07:29 PM
Udev Rule Help Please Toods Slackware 1 11-23-2007 08:55 AM
need help with udev rule hussam Linux - Software 2 12-05-2006 03:30 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:21 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration