LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 03-09-2010, 12:32 PM   #1
nemesis9
LQ Newbie
 
Registered: Jul 2009
Location: Arizona
Distribution: Redhat Fedora
Posts: 20

Rep: Reputation: 1
halevt does not pass mount-point to my script during OnInit


I am running halevt to support removable media for a custom system. I have an OnInit rule as follows: (OnInit means the device was already inserted before halevt was started)

<halevtevice match="&MOUNTABLE; &amp; (!hal.volume.is_disc | hal.volume.is_disc=false)">
<halevt:OnInit exec='halevt-mount -u $hal.udi - m 002 ; usr/sbin/myProgram Add_Init USB "$hal.udi$ "$hal.volume.mount_point$'/>
</halevtevice>

myProgram is called but the $hal.volume.mount_point$ is null. When I check in /media the device is mounted there. So why was I passed null for the mount point, is there some kind of race condition.

I have a similar rule for the case where a device is inserted after halevt is already started, and it works fine. That rule is for the case where a device gets a mount point, but in the case where halevt is started after a device is inserted, even that rule is not called.
Any ideas?
 
Old 03-10-2010, 08:57 AM   #2
berbae
Member
 
Registered: Jul 2005
Location: France
Distribution: Arch Linux
Posts: 540

Rep: Reputation: Disabled
Try to separate the two actions, because I think halevt will be called another times when the device gets mounted :
Code:
<halevt:Device match="&MOUNTABLE; &amp; hal.volume.is_disc=false">
   <halevt:OnInit exec='halevt-mount -u $hal.udi$ - m 002'/>
</halevt:Device>

<halevt:Device match="hal.block.device &amp; hal.block.is_volume = true &amp; hal.volume.mount_point">
   <halevt:Property name="hal.volume.is_mounted">
      <halevt:Action value="true" exec='usr/sbin/myProgram Add_Init USB "$hal.udi$ "$hal.volume.mount_point$'/>
   </halevt:Property>
</halevt:Device>
You will have to adapt the second match conditions to execute myProgram only when it is required. The example above will run it each times any block device volume is mounted.
Also I don't know if you call your program with "usr/sbin" or "/usr/sbin";
and are you sure of the double quotes in :

myProgram Add_Init USB "$hal.udi$ "$hal.volume.mount_point$
?

I just realized you missed a $ in your exec line and the ; doesn't seem correct too :
<halevt:OnInit exec='halevt-mount -u $hal.udi - m 002 ; ...
instead of
<halevt:OnInit exec='halevt-mount -u $hal.udi$ - m 002 &amp;&amp; ...

Maybe it is enough to make your command to work.

Last edited by berbae; 03-10-2010 at 09:23 AM.
 
  


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
halevt cannot mount because of permissions senseproof Linux - Software 5 11-20-2010 11:06 AM
halevt run as init script doesn't mount for users nemesis9 Linux - Desktop 1 11-05-2009 07:38 AM
puppy+grub saves ram installed mount point as HD install mount point agualust Linux - Newbie 0 04-10-2009 11:23 AM
shell script - monitor mount point noir911 Programming 1 03-20-2008 06:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 07:19 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration