Couchpotato is the owner of the media

  • What am I trying to do?
    Using Kodi on a client machine (in this case an amazon fire tv stick accessing content from omv via samba), I want to be able to write directly to the folder in which the media (TV, film, music etc) is kept on the OMV box. This would mean "/Media/UUID/Video/Film/[title name]" as an example.


    What's the issue?
    One function of couchpotato is to use the couchpotato renamer, which is great. This allows couchpotato to create a subfolder in the folder of your choice, and name it according to conventions that you wish (such as name, year etc). When couchpotato does this, it does so as the couchpotato user obviously, and owns the folder. Since the kodi user (on the fire stick) is not couchpotato, it doesn't have write permissions, so it can't write to the individual folder name. Ideally, I'd like to be able to write to folders using kodi, but not delete - if this is possible.


    What can be done?
    I've thought of some possible solutions, but not sure if any of my thinking is correct (or I will mess something up). Hopefully someone can point me in the right direction:


    Option 1: Change the owner of the video folder, recursively. This might work straight away, but any new folder created by couchpotato in future would have the same problem again.
    Option 2: Reset permissions on the video folder, using the OMV gui. I'm not sure if this will work, or will have the same problem as the Option 1.
    Option 3: Tell kodi to login as the couchpotato user. Risky? Would this create more trouble than it solves? Kodi would then have access to write to the video folder, but some other files in there could be owned by a different user in future, so this would be a temporary fix.
    Option 4: Give the user on the kodi machine write permissions. Or give the user group write permissions. I did try to give the users group write permissions, but it didn't work. Perhaps I did it wrong.
    Option 5: Maybe someone has a better idea than all these?!


    Advice appreciated - it's all a learning process.

    • Offizieller Beitrag

    You need to setup a umask for couchpotato. I don't know if couchpotato has this or file creation mode. In there you can put 775 for folders and 664 for files. In that way you ensure all the users in the "users" group can write. I assume kodi is normal user created in the wwebui,so he'll be in the users group.
    Remember that what controls what can be deleted or created are the permissions on the folder above of what you're trying to write.

  • You can also use ACLs and a default acl for the user you want on the folder where couch potato writes (with e.g. setfacl -d -m u:kodi:rwX folder, and then also setfacl -R -m u:kodi:rwX folder to set existing ACLs), then any new files will inherit these ACLs and be accessible to the kodi user.

  • Also, use the sticky bit to prevent users from being able to delete files they don't own even though they have write access. Since couchpotato owns your files, kodi will not be able to delete them, although it will be able to delete files it creates and thus owns.

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!