I reinstalled my desktop for Trusty and I installed minidlna.
At Trusty install time I decided to insist in using an internal 1TB SATA drive to store multimedia files for minidlna usage. I had this whole drive formated with 4GB for swap, 5GB for /tmp, 5GB for /var and the remaining 900+GB as an ext4 partition that I specified will be mounted as /srv in the Ubuntu install wizard.
In Precise, I met trouble/puzzle to easily use this.
Now, I created directories:
sudo -i mkdir -p /srv/minidlna/Movies mkdir /srv/minidlna/Music mkdir /srv/minidlna/Pictures
and populated them with a backup copy.
/srv will later also be used to store she and me $HOME weekly backups (deja-dup over ssh) from our respective laptops... just to say it is not really fully dedicated to minidlna.
I have 3 PAM user accounts:
me (single administrator in the machine),
I also have the minidlna service running with default personality (I don't know if I can say it is user minidlna or root, but that don't really matters as I'd rather keep it as is if nobody gives a good advise to change this (
minidlna.conf I would just change the mass-storage target and
I apply the same
755 minidlna:minidlna permissions/ownership to
/srv/minidlna as they are on the
/var/lib/minidlna default target:
chown -R minidlna /srv/minidlna chgrp -R minidlna /srv/minidlna chmod -R 755 minidlna service minidlna restart
which ends ~ok~ (roughly translated) in
[2014/07/26 18:28:20] minidlna.c:153: warn: received signal 15, good-bye [2014/07/26 18:28:21] minidlna.c:1004: warn: Starting MiniDLNA version 1.1.2. [2014/07/26 18:28:21] minidlna.c:356: warn: New media_dir detected; rescanning... [2014/07/26 18:28:21] minidlna.c:1043: warn: HTTP listening on port 8200 [2014/07/26 18:28:21] scanner.c:702: warn: Analysing de /srv/minidlna [2014/07/26 18:29:11] scanner.c:789: warn: Analysing /srv/minidlna ended (2960 files) ! [2014/07/26 18:29:11] playlist.c:125: warn: Parsing playlists... [2014/07/26 18:29:11] playlist.c:256: warn: Finished parsing playlists. [2014/07/26 18:29:12] inotify.c:198: warn: WARNING: Inotify max_user_watches  is low or close to the number of used watches  and I do not have permission to increase this limit. Please do so manually by writing a higher value into /proc/sys/fs/inotify/max_user_watches.
Well, sorry for such a long preamble, now I want all us three me/she/kids to be able to drop files/make dirs/move/del files/dirs into /srv/minidlna/Movies|Music|Pictures easily (and as a bonus prevent deletion of any of the 4 parents), without always have to ask me to do this for obscure permissions restrictions. In the past Precise, the folder was owned by root, group was minidlna and I added us three as members in the group. Maybe
chmod was too restrictive, I can't remember, just remember it was boring. Maybe I puzzled/confused myself with primary/secondary groups as I still can't understand how they are imbricated or linked into each other, so that she or kids can move/delete files/folders I dropped/created there in the whole 3 subtrees. Maybe also I was too nasty with removing
Please what is the good way if any? We are every where advised not to play with umask (whose man is too cryptic to me, whatever).
Thank you so much for reading such a long question, but as it is a security factual example, I believe an answer could be a good training to make me and others, I hope, a little more aware and easy in this matter of privileges.