Locks optical drive, prevents hardware triggered ejection of cd/dvd tray.
https://github.com/mmzx/odrive_locker.git
#ENV{DISKEJECTREQUEST}=="?*", RUN+="cdromid --eject-media $devnode", GOTO="cdromend"
in file /etc/udev/rules.d/60-cdrom_id.rules, as attached.