On Sun, Sep 16, 2012 at 8:51 PM, Saurabh Shandilya <
[email protected]> wrote:
> hello experts,
>
> I am kindof stuck at a point, and really need your help.
>
> I wrote a simple rule for my udev, which is as follows,
> KERNEL=="sd?", ATTRS{idVendor}=="xxxx", ATTRS{idProduct}=="xxxx",
> ATTRS{serial}=="-----", SYMLINK+="mydrive", RUN+="/home/beyond/runn.sh"
>
> &
>
> runn.sh is as follows:
> #!/bin/sh
> echo "it is being executed"
> echo "writing to file" > /home/beyond/Downloads/abc.txt
> /home/beyond/myfile
> echo "done"
>
>
> Whenever I inserts my pandrive, I got the abc.txt file in my folder, but
> not able to get the display of the echo lines and also I am not able to
> execute any other C program using this script.
>
> Kindly tell and help me out,
> Udev is an user space process, so it executes the rules with super user
> rights??
> when the abc. txt file is executed, then why the echo commands are not
> displayed & actually where are they expected to be displayed? I mean what
> is the standard output of the echo command when such a file is executed?
> Also, the C program executable binary is not executed, ((myfile is a
> simple opengl based green coloured window pop up))
>
>
> Regards,
> saurabh shandilya
> http://about.me/shandilyasaurabh
> www.beyondszine.wordpress.com
> 9910118292
>
>
Got something from here
udev does not run these programs on any active terminal, and it does not
execute them under the context of a shell. Be sure to ensure your program
is marked executable, if it is a shell script ensure it starts with an
appropriate shebang <http://en.wikipedia.org/wiki/Shebang_(Unix)> (e.g.
#!/bin/sh), and do not expect any standard output to appear on your
terminal.
SRC:http://www.reactivated.net/writing_udev_rules.html
Is it really not possible this way?? then how to do it the other way ;)
any help is highly appreciated..
--
Regards,
saurabh shandilya
http://about.me/shandilyasaurabh
www.beyondszine.wordpress.com
9910118292
--
Mailing list guidelines and other related articles: http://lug-iitd.org/Footer