Snakeoil Forums

Full Version: Anybody know anything about /etc/udev triggers for autoripping?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
SO I can't seem to get my udev script to work in order to start up abcde for auto ripping.  

my udev rule is in a file called: 

/etc/51-autoripcd.rules

and it contains the following line

    SUBSYSTEM=="block", KERNEL=="sr0", ACTION--"change",  RUN+="/usr/bin/cdautoinsert &"

which should run the following script /usr/bin/cdautoinsert if a CD is inserted:

   #!/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

I can only get this script to run if I run it directly with sudo.  I can't seem to get it to start on CD insert or without sudo from the command line. Part of that I realize is a permissions thing,  but I can't seem to get to any of it on inserting a CD.

Anyone have any experience here?

tnx
73
Tim
(11-Jul-2021, 01:29 AM)Coacharnold Wrote: [ -> ]SO I can't seem to get my udev script to work in order to start up abcde for auto ripping.  

my udev rule is in a file called: 

/etc/51-autoripcd.rules

and it contains the following line

    SUBSYSTEM=="block", KERNEL=="sr0", ACTION--"change",  RUN+="/usr/bin/cdautoinsert &"

which should run the following script /usr/bin/cdautoinsert if a CD is inserted:

   #!/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

I can only get this script to run if I run it directly with sudo.  I can't seem to get it to start on CD insert or without sudo from the command line. Part of that I realize is a permissions thing,  but I can't seem to get to any of it on inserting a CD.

Anyone have any experience here?

tnx
73
Tim

Hi Tim, I seem to recall that 'eject' needs to be installed for that to work. I may be wrong but that's first thought.
https://packages.ubuntu.com/search?keywords=eject
Please try the following:
  1. Create a custom.service file similar to this
    Code:
    [Unit]
    Description=My custom startup script
    After=syslog.target network.target

    [Service]
    # run my_startup script as user root
    #
    User=root
    ExecStart=/bin/bash /home/xx/my_startup.sh

    [Install]
    WantedBy=multi-user.target
  2. Copy custom.service to /etc/systemd/system
  3. Reload the config: sudo systemctl daemon-reload
  4. Start the service: sudo systemctl start custom
  5. Check the service status: sudo systemctl status custom
  6. If all ok, enable the service so it runs automatically: sudo systemctl enable custom
More systemctl info here
https://www.digitalocean.com/community/t...-and-units