i'm not shure if makemkv or my distribution itself causes the problem but i cant get makemkvcon doing its job when started from udev rule. I'm not a linux wizard and this was my first time setting up a udev rule.
I have a headless Ubuntu Server (16.10) running and first thing i have done was setting up a script (ripdisc.sh) which rips a disc, moves files into certain directories and does some logging. This runs just fine when started manually from the bash. Doesnt make a difference if started as root or myusername.
Then i set up a udev rule which reacts if a disc is inserted. This also works now and starts my script. All commands inside my scripts are executed but makemkvcon does nothing but drops "Application failed to initialize" or nothing (cant provide u any further information right now since i'm currently not on this maschine). My device (/dev/sr0) is there since blkid is able to grap the discs title..
I invested a bunch of time googling and found that you can't start long living processes from udev. So i set up another ("in-between") script (run_on_disc_inserted.sh) which is called by udev and simply starts my ripping script in this way:
Code: Select all
/bin/bash sudo -u myusername /pathtoscript/ripdisc.sh & exit
Then i came up with kind of a hack: My udev rule now is just putting an empty file at a certain position. Like so:
Code: Select all
Well. This solution now works like expected! But:
1. This isnt the nicest approach and
2. I would like to know why my script works fine if called through crontab but not if called through udev?! What is the missing bit i don't see?
I should mention: Initially i installed makemkv from the packages but i had problems with my blu-ray drive and wasn't sure what causes this so i deinstalled the package stuff, downloaded the sources and compiled/installed makemkv by myself. Later i realize that my drive causes the problems and i went for a new one which then worked ootb. After having the first problems with this udev stuff i deinstalled makemkv manually by removing the files by hand and then reinstalled it from the packages. Maybe something went wrong here? How can i find out what files have to be in which places and what files makemkvcon actually needs?
Another thing: If my ripping script is started through crontab makemkvcon tells me some stuff related to auto updates and that i'm in a 30 days testing period. If I start the script manually these messages doesnt appear. Yes, i have settings.conf set up with the current key and the .MakeMKV folder is in myusernames home as well as in the roots home.
Thanks for your time!