Re: Unmount optical media with eject button
Reply #9 –
# cat /etc/polkit-1/rules.d/50-customactions.rules
[Actions for kodi user]
Identity=unix-user:kodi
Action=org.freedesktop.upower.*;org.freedesktop.consolekit.system.*;org.freedesktop.udisks.*;org.freedesktop.udisks.filesystem-mount;org.freedesktop.login1.*
ResultAny=yes
ResultInactive=yes
ResultActive=yes
# cat /etc/polkit-1/localauthority/50-local.d/custom-actions.pkla
[Actions for kodi user]
Identity=unix-user:kodi
Action=org.freedesktop.upower.*;org.freedesktop.consolekit.system.*;org.freedesktop.udisks.*;org.freedesktop.udisks.filesystem-mount;org.freedesktop.login1.*
ResultAny=yes
ResultInactive=yes
ResultActive=yes
Doesn't seem to make any difference. Probably doing it wrong, the existing rules in /etc/polkit-1/rules.d/99-artix.rules look quite different in format, perhaps things have changed now? If I run kodi as root (obviously not advisable for normal use) then it still doesn't mount /dev/sr0 itself, and can't play the DVD until it has been mounted. But running as root the onscreen eject button works and /dev/sr0 is unmounted if it's already mounted, and ejected. And I can't change ownership of the mounted DVD because it's read only so stays as nobody:nobody.
Even if I got that part to work, it still wouldn't alter the OP's problem of the physical eject button on the drive itself not triggering a umount, that might be something outside of kodi if it doesn't mount things itself.