Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Solved: USB device mounted but not seen in moOde (warning: long post)
#1
Hello everybody,

yesterday I just got a new 1TB disk for my RPi3+ running KODI, so I got its "old" 320GB usb-disk for use in my RPi4 running MoOde... so far so good, you would say, uh?

This is what I did: (which is what I _always_ do, BTW)

1. move everything to the new disk
2. remove all partitions from the 320GB disk
3. create a new, main partition taking up the whole disk, and format it as Ext4 (no encryption whatsoever...)
4. copy over all the music taken out of the "older" 250GB usb-disk which was the only music source in moOde (that is, till just before starting this disk-swap thing)
5. start moOde.

What I saw:

1. there is no USB entry in the folder view, only the 3 radio-playlists I created, and the SDCARD
2. doing a library rescan does not find any music on the USB
3. the automatically called thumbnail update DOES generate 225 (times 2) thumbnails gotten from the usb-disk
4. the above, of course, happens because the usb-disk is INDEED mounted (/media/Spare 2)

I remember that when I first started playing with moOde, I couldn't see the USB too, then I mounted a SMB (local) share on the same disk, and was able to see everything. Then after a few reboots (for other reasons) I started seeing the USB, and I noticed all the songs being doubled (of course... one time for the SMB, and one time for the USB), so I removed the SMB share, rescanned the library, and everything has been OK since: only USB mounted, seen and scanned; all thumbnails (no duplicates), all album art.

This time was not so, no matter what I did... so I decided to look into the logs, and found this in /var/log/mpd/log:
Jun 24 08:32 : exception: Failed to open /var/lib/mpd/music/USB/Spare 2: Permission denied

the "/media/Spare 2" folder, which is the root of the usb-disk (its label is "Spare 2"...) was being mounted with all permissions reset, except for the owner (pi):
rwx------

It never happened to me... it is always rwxr-xr-x

So, I changed it to be as it should, and voilà, everything is up and running again.

Question is:
The thumbnail generation code runs as user "pi", hence it was able to see the "Spare 2" folder, as belonging to user "pi". So far so good.
The mpc, OTOH, I believe runs with a different user name... maybe "mpd"? which falls in the "other" group file-permissions (which were all denied)

Shouldn't MPD / MPC run as "pi" too? (not root, of course)
Bear in mind that (in my weird situation) even having MPD member of the group "pi" wouldn't have solved the issue.

Just asking, and perhaps helping others facing the same issue.


Thanks for your attention, if you managed to read this far :-)

Kind regards, Al.
Reply
#2
The thumbnail generator is launched by worker.php which runs as root.

See cases below in /var/www/daemon/worker.php

update_library
regen_library
regen_thmcache
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply


Forum Jump: