PirateBox-Dev / PirateBoxScripts_Webserver

PirateBox Scriptcollection for running in Webserver
GNU General Public License v3.0
206 stars 102 forks source link

minidlna fails to start on Raspberry Pi #187

Open TheExpertNoob opened 6 years ago

TheExpertNoob commented 6 years ago

ERROR: Failed to open sqlite database! Exiting... Exit code 255

Tested on a new image with latest 1.1.3 build on a different sdcard with none of my modifications as I thought some of my modifications/updates may have caused the issue initially.

MaStr commented 6 years ago

Is it on the first boot or on a second boot where it did fail? Did you apply the piratebox minidlna configuration like in this howto https://piratebox.cc/raspberry_pi:diy ?

TheExpertNoob commented 6 years ago

failed on first boot applied piratebox config as stated from diy rebooted, still failed. uninstalled via pacman -Rs (removed dependencies) removed minidlna.conf (and bkup) files reinstalled with dependencies -S (asked which provider) (1) libx264 2) libx264-10bit) chose 1 stopped minidlna service manually edited config manually to point to /mnt/usbshare/share/Shared as the media_dir and db_dir=/opt/piratebox/share/minidlna started minidlna service manually started with no errors, so I enabled the service. ...waited for db to configure... ...rebooted... no errors. ... and I believe I found the issue... the example config points to /opt/piratebox/tmp which is owned by nobody:nogroup(755) and on the sdcard. by manual editing the minidlna.conf file, I set it to /opt/piratebox/share/minidlna (for whatever reason, probabaly openwrt) which is on fat32 USB drive with full permissions (777/umask=0) owned by nobody:nogroup but all users including minidlna:minidlna can write to which minidlna runs as if not specified. so example script needs to be set as user=nobody OR the path to the db_dir needs to be changed for RPi.

MaStr commented 6 years ago

I think the service under arch must be adjusted to run as nobody:nogroup , because this is the user context we are running in. This must be done during RPi image generation .. or we provide a copy of the minidlna.service in the src folder, which is copied over during activation.

BTW: good catch 👍