Page 1 of 1

/mnt/dietpi_userdata permissions reset after software install

Posted: Wed Jul 31, 2019 9:18 am
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?

Re: /mnt/dietpi_userdata permissions reset after software install

Posted: Thu Aug 01, 2019 4:02 am
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

Re: /mnt/dietpi_userdata permissions reset after software install

Posted: Thu Aug 01, 2019 9:16 pm
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.

Re: /mnt/dietpi_userdata permissions reset after software install

Posted: Fri Aug 02, 2019 10:36 am
by Tarrasque
thank you very much for your answer and support.

Re: /mnt/dietpi_userdata permissions reset after software install

Posted: Sat Aug 10, 2019 4:39 pm
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.

Re: /mnt/dietpi_userdata permissions reset after software install

Posted: Thu Aug 29, 2019 9:24 am
by Tarrasque
Thank you very much.