You are not logged in.
Hello,
I want to auto rip music cd's when I insert them in my cd-tray. I wrote a Udev rule for that and the rule does seem to work.
This is my rule:
KERNEL=="sr*", SUBSYSTEMS=="scsi", ENV{ID_CDROM_MEDIA_CD}=="1", RUN{program}+="/usr/bin/cdautoinser"
When I check this with:
udevadm test /sys/block/sr1
Then I can see udev loads the script, but nothing happens.
This is my script, I got it from here: http://jctechnotes.blogspot.com/2012/10 … using.html
#/bin/bash
PATH=/usr/lib64/ccache:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin /bin/abcde -NVP | tee /var/log/abcde-auto.log &
exit
Can somebody help me what's wrong?
For I forget, I use a usb DVD-drive, but I don't think it matters because udev seems to do what it should do.
Offline
Yes, udev does do what it should - but what you want it to do is not what it should do. Udev rules should not be used like that. Such invocations tend to fail as udev will kill any child process that continues to run for some time (I don't know the exact threshold, but it's much short than what it takes to rip a cd).
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
That is what I understood reading the manpages. But if it's not possible this way, can I let Udev run a small script that kills itself but let abcde do it's job?
Offline
I'm not sure. I just went hunting, but couldn't find clear info on this, except that it is not recommended to use udev in this way.
maybe using a `setsid nohup <command> &` invocation would help.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
Ok, thanks for the tip. I will try for now.
If I understand it should be better to make a symlink to , for example, /dev/musiccd and let a daemon trace dev for this device. When it finds it it should execute the abcde. Am i right?
Offline
I found what I was looking for in the arch forum. udevil & devmon should do the trick.
Thanks for the help, it brought me to a different path.
Offline