/mnt/dietpi_userdata permissions reset after software install Topic is solved

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
Post Reply
Tarrasque
Posts: 10
Joined: Wed Jun 26, 2019 11:13 am

/mnt/dietpi_userdata permissions reset after software install

Post by Tarrasque »

Hi all.

I have manually installed a couple of applications that are not present in the official DietPi software catalog (for the record, amule and jdownloader)

I created an user for each of them and installed them under /mnt/dietpi_userdata, each in it's own home directory, owned by the respective user.

So, just to be clear, an entry in /etc/passwd would be:

Code: Select all

amule:x:1001:1001::/mnt/dietpi_userdata/amule:/usr/bin/nologin
And the folder structure is

Code: Select all

drwxrwxr-x    amule    amule    /mnt/dietpi_userdata/amule
Of course, each application has it's own service that starts them using their private user.

The problem I encountered is that whenever I install new software using dietpi_software, the owner of the folders under /mnt/dietpi_userdata is forced back to dietpi:dietpi and this of course breaks the applications.

Is it a feature? Can I avoid this behaviour? Must I install personal software somewhere else?
User avatar
johnvick
Legend
Posts: 693
Joined: Wed Jun 08, 2016 11:53 am
Location: New Zealand

Re: /mnt/dietpi_userdata permissions reset after software install

Post by johnvick »

Yes this is a known "feature" - you can get round it by installing elsewhere or in my case I have a cron job doing chown etc.
Hopefully it will get fixed @MichaIng ?

John
User avatar
MichaIng
Site Admin
Posts: 2421
Joined: Sat Nov 18, 2017 6:21 pm

Re: /mnt/dietpi_userdata permissions reset after software install

Post by MichaIng »

@johnvick @Tarrasque
Yeah it's on the list, will see if I can do that tomorrow: https://github.com/MichaIng/DietPi/issues/2641
Definitely a must, the more I think about it, also security-wise.
Tarrasque
Posts: 10
Joined: Wed Jun 26, 2019 11:13 am

Re: /mnt/dietpi_userdata permissions reset after software install

Post by Tarrasque »

thank you very much for your answer and support.
User avatar
MichaIng
Site Admin
Posts: 2421
Joined: Sat Nov 18, 2017 6:21 pm

Re: /mnt/dietpi_userdata permissions reset after software install

Post by MichaIng »

@Tarrasque @johnvick
Okay the change has been merged into dev code: https://github.com/MichaIng/DietPi/pull/3040

Permissions are now applied per-software install and never for the whole dietpi_userdata dir.

The media content dirs (Music/Video/Pictures/downloads) get dietpi:dietpi 775 permissions at start of every dietpi-software install, but not contained files, just the dirs themselves. This is required to assure that media- and download software has permissions to create files, e.g. new downloads, importing media libraries etc. But special permissions applied to contained files are not overwritten.
Tarrasque
Posts: 10
Joined: Wed Jun 26, 2019 11:13 am

Re: /mnt/dietpi_userdata permissions reset after software install

Post by Tarrasque »

Thank you very much.
Post Reply