Kodi Community Forum

Full Version: [solved] unmount external disk polkit rule (no udisks)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I use a udev rule that automounts external drives. It works fine. But I cannot "safely unmount" the drive, since I have no polkit rule to let the kodi user unmount the drive. I have googled extensively for the answer for it, but all the answers are related to udisks, and I do not use udisks. Could someone point me to the right direction? (I can safely unmount when I run Kodi as root, so I know it's working).
You have very likely poorly setup Kodi and have not added the user running Kodi to the necessary groups.

run the command

Code:
id <usernamerunningkodi>

On my machine the username running kodi is kodi and the result of that command is

uid=1000(kodi) gid=1000(kodi) groups=1000(kodi),6(disk),24(cdrom),27(sudo),29(audio),44(video),46(plugdev),105(fuse)

If thats not your result more or less you have setup incorrectly and now you can go seek for the info on how to do that on the vast intranet resources online.
Blimey, you're right. I had most of that, except disk. Now it works. Doh.

Edit: no, that didn't solve it. I guess i'll just have to upgrade my google-fu...
paste you customactions.pkla
[Actions for kodi user]
Identity=unix-user:kodi
Action=org.freedesktop.upower.*;org.freedesktop.consolekit.system.*;org.freedesk​top.udisks.*;org.freedesktop.login1.*
ResultAny=yes
ResultInactive=yes
ResultActive=yes

[Untrusted Upgrade]
Identity=unix-user:kodi
Action=org.debian.apt.upgrade-packages;org.debian.apt.update-cache
ResultAny=yes
ResultInactive=yes
ResultActive=yes


I've also tried to install udisks, but for some reason udisks automounting has never worked for me, and I still can't "safely remove". (to be on the safe side, I have also removed my other udev automounting rule) Pmount also works fine to mount/unmount without sudo, but that doesn't help with kodi. I also thought Kodu uses udisks for unmounting, but how come Kodi "safely removes" just fine when run as root without even udisks installed?
You already said that. FYI you should not run Kodi as root, for one its wrong and also makes me wonder how badly you setup Kodi in first place.

1 question, what is the user you have running kodi, and please dont say root.
pasbin a full Debug Log that will tell us.

Try this
Code:
[Actions for kodi user]
Identity=unix-user:kodi
Action=org.freedesktop.upower.*;org.freedesktop.consolekit.system.*;org.freedesk​top.udisks.*;org.freedesktop.udisks.filesystem-mount;org.freedesktop.login1.*
ResultAny=yes
ResultInactive=yes
ResultActive=yes

If your user running kodi is called something lese you need to modify the above

Quote:[Actions for kodi user]
Identity=unix-user:username_running_kodi_here
Action=org.freedesktop.upower.*;org.freedesktop.consolekit.system.*;org.freedesk​top.udisks.*;org.freedesktop.udisks.filesystem-mount;org.freedesktop.login1.*
ResultAny=yes
ResultInactive=yes
ResultActive=yes
You are assuming a little too much here.

I *am* running Kodi as user "kodi". (If I ran as root I wouldn't have any permission problems in the first place) I just ran Kodi as root to narrow down the possibilites where the cause might lie. I could "safely remove" as root, and that excludes the possibility that something is wrong with Kodi itself.
I am assuming, simply because you havent posted any real information, that would allow me to make a reasonable educated guess.

Repeating what you have done is not valid information its just something random you have done that doesn't help me help you at all.

Real information would be debug logs, output of the commands I asked for earlier and any how-tos you may have followed as well as the config files you have running.

ATM I only know you are in some Linux (which no idea), That you are running Kodi (which no idea), that you have some permission related issue which is likely to be some missed configuration or wrong configuration.

Im getting frustrated with this more than you are with your issue, Big Grin
I did not repeat myself, but added some more info of other steps that I have tried out. (To counter the inevitable "try to install udisks" suggestion")

However, I do take som self criticism for not adding more key info. I guess I thought this was going to be a simple question and that I had missed some obvious thingy. Anyways..

Ubuntu 14.04, Kodi 15.2rc2. Minimal install following Fritsch' guide.

id kodi:
uid=1000(kodi) gid=1000(kodi) groups=1000(kodi),4(adm),6(disk),20(dialout),24(cdrom),27(sudo),29(audio),30(dip),44(video),46(plugdev),100(users),109(lpadmin),110(sambashare)

/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.freedesk​top.udisks.*;org.freedesktop.login1.*
ResultAny=yes
ResultInactive=yes
ResultActive=yes


log:
DBus: Error org.freedesktop.UDisks.Error.PermissionDenied
(2015-09-25, 13:15)Soli Wrote: [ -> ]log:
DBus: Error org.freedesktop.UDisks.Error.PermissionDenied

You cant be serious! What am I suppose to do with 1 log line?

on another note try the suggestion 4 posts before.

And Im ready to give up on you.
After adding "org.freedesktop.udisks.filesystem-mount" udisks will automount, and I can safely remove inside Kodi GUI.

So I guess it's solved, but I wonder about:
1) How is that different from org.freedesk​​top.udisks.*
2) My Chromebox install with Kodibuntu only has org.freedesk​​top.udisks.* , and it works fine, which is strange..
No idea, I think Im already traumatized enough to even go there. Big Grin

So now whats left is me getting a well deserved chocolate cookie +1 and you marking thread as solved.
You do deserve a cookie. Thanks.
                           ,,      ,▄                               
                      ██████▒▒▄                           
                   ╣╢╣╢╢╢╢╣╢,                     
                █████╢╢╢╢╢╢╢╢╢╣╢▒████,                 
             ,╢╣╢▒╢╢╢╢╢╢╢╢╣╢╣█████╢╣╢▄               
           ▄╣╢╢╢╣╣╢╣╢╣╢╢╣╣╢╢╢╢╢╢╢╢╢╣╣╣███╢╢╢╣╢╢██▄             
          ╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╣╢██╣╢╢╢╢╢╣╢╣╢▄          
        ╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╣╢╢╢╢╢╣╢╢╢╢╢╢╢╣╢╣╣╣╣╢╣╣╢╣╢╢╢╢╢╢╢╢╢▓▒██▄        
      ╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╣╢╣███╣╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╣╢╣╢███▄      
     ██╢╢╢╢╢╢╢╢╢╢╢╢╢╢╣╣████╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╣╢╢█████▌     
     ████╣╢╢╢╢╢╢╢╢╢╢╢╢╣╫██████╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╣╢╣█████▄    
   ▄██╣╣╢╢╢╢╢╢╢╢╢╢╢╢╢╢███████╣╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╣▒██████    
  ╢╢╢╢╣╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╣╢╢██╢╣╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╣╢▒╢╢▌   
 ╣╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╣╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╣█   
 ╢╣╢╢╣╢╣╣╣╢╣╣╣╣╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╣╣╣╣╢╢╣╢╢╢╢╢╢╢╢╢╢╢╢╢╢╣╣╣╢╣µ  
╣╢╢╢╢╣╢╣╣╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╣╢╣▒██╣╢╢╢╢╢╢╢╢╢╢╢╣╢╢╢█  
 ╢╢╢╢╢██╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╣╢╢██╢╢╢╢╢╢╢╢╢╢╢╣╢╢╣███▌ 
 ╣╢╢╢╢█████╣╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╣╢╣╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢█ 
 ╣╢╢╢╢████╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╣╢╢╢╢╢╢╢╣╢╢▒▒╢╢╢╣╢╣╢╣╢╢╢╢╢╢╢╢╣╢╢╫
 ╣╣╢╢╢╢██╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╣╢╢╢╢╣╢╢╢╢╢╢╢╢╢╢╣╢╢╢╢╢╢╢╣╢╢╢╢╢╢╢╢╢╢╢╢╣█ 
 ╣╣╢╢╢╢╣╣╢╣╣╣╣╢╣╢╢╢╢╢╢╢╢╢╢╢╢╢╢╣▒██╢╢╢╢╢╢╢╢╣╢╢╢╢██╢╢╢╢╢╢╢▓▓█ 
 █╣╣╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢███╢╢╣╢╢╢╢╢╢╢╢╢████╢╢╢╢╢▓▓
 ╣╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╣████╢╢╢╢╢╢╢╢╢╢╢█████╣╢╢╢╣▓▓▌  
  ╢╢╢╢╢╢╢╢╢╢╢╢╢╢╣╢╢╢╢╢╢╢╢╣██╢╢╢╢╢╢╢╢╢╣╢╢█████╢╣╢╢█   
   ██╢╣╢╢╢╢╢╢╢╣╣╢▒██╢╢╢╣╣╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╣▒▒▒╢╣╣╢╣▓▓█    
   ╣╣╢╢╢╢╢╢╢╢╢╢███╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢▓▓▓▀    
    ╣╢╢╢╢╢╢╢╢╢╢╣██╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╣╢╢╢╢███      
      ╢╣╢╢╢╢╢╣╢╢╣╢╣╢╢╢╢╢╢╢╢╢╢╢╢╢╢╣╢╣╢╢╢╢╢╢╢╣╢╢╢╢╢╣╣█████▀       
        ╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╣╢██╢╢╢╢╢╣╢████         
          ██╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╣█████╢╢╢▀          
           ╢╣╢╣╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢╢█████▓▓▓▓▓██            
            ╢╢╢╢╢╢╢╢╢╢╢╢╣╢╢╢╢╢╢╢╢╢╣████▓▓▓▓▀             
                ▓▓███╣╢╢╣╣╢▓▓▓▓▓▓▓▓▓▓▓██▀                 
                   ███▓▓▓▓▓▓▓▓▓▓▓▀                     
                      ███████▓▓▓▓█████▀                        
                             ▀████▀▀▀                             

(2015-09-25, 13:38)Soli Wrote: [ -> ]You do deserve a cookie. Thanks.

Would have been easier to click thank user, I guess that at least counts as some effort.