/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: 8
Joined: Wed Jun 26, 2019 10:13 am

/mnt/dietpi_userdata permissions reset after software install

Post by Tarrasque » Wed Jul 31, 2019 9:18 am

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: 653
Joined: Wed Jun 08, 2016 10:53 am
Location: New Zealand

Re: /mnt/dietpi_userdata permissions reset after software install

Post by johnvick » Thu Aug 01, 2019 4:02 am

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
Legend
Posts: 1626
Joined: Sat Nov 18, 2017 5:21 pm

Re: /mnt/dietpi_userdata permissions reset after software install

Post by MichaIng » Thu Aug 01, 2019 9:16 pm

@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: 8
Joined: Wed Jun 26, 2019 10:13 am

Re: /mnt/dietpi_userdata permissions reset after software install

Post by Tarrasque » Fri Aug 02, 2019 10:36 am

thank you very much for your answer and support.

User avatar
MichaIng
Legend
Posts: 1626
Joined: Sat Nov 18, 2017 5:21 pm

Re: /mnt/dietpi_userdata permissions reset after software install

Post by MichaIng » Sat Aug 10, 2019 4:39 pm

@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: 8
Joined: Wed Jun 26, 2019 10:13 am

Re: /mnt/dietpi_userdata permissions reset after software install

Post by Tarrasque » Thu Aug 29, 2019 9:24 am

Thank you very much.

Post Reply