Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 426726 - net-misc/minidlna-1.0.24 - daemon fails to start
Summary: net-misc/minidlna-1.0.24 - daemon fails to start
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal
Assignee: Michael Weber (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-07-15 15:56 UTC by snowy.mail
Modified: 2012-07-20 08:08 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description snowy.mail 2012-07-15 15:56:22 UTC
After /etc/init.d/minidlna start net-misc/minidlna-1.0.24 does not work.
/etc/init.d/minidlna status shows status: crashed
No errors in /var/log/minidlna.log or /var/log/messages

minidlna-1.0.22 was working with the same config file without problems.

Reproducible: Always




emerge --info

Portage 2.1.10.65 (default/linux/x86/10.0, gcc-4.5.3, glibc-2.14.1-r3, 2.6.39-gentoo-r3 i686)
=================================================================
System uname: Linux-2.6.39-gentoo-r3-i686-Intel-R-_Pentium-R-_4_CPU_2.80GHz-with-gentoo-2.1
Timestamp of tree: Sun, 15 Jul 2012 15:05:01 +0000
ccache version 3.1.7 [enabled]
app-shells/bash:          4.2_p20
dev-lang/python:          2.7.3-r2, 3.2.3
dev-util/ccache:          3.1.7
dev-util/cmake:           2.8.6-r4
dev-util/pkgconfig:       0.26
sys-apps/baselayout:      2.1-r1
sys-apps/openrc:          0.9.8.4
sys-apps/sandbox:         2.5
sys-devel/autoconf:       2.13, 2.68
sys-devel/automake:       1.11.1
sys-devel/binutils:       2.21.1-r1
sys-devel/gcc:            4.5.3-r2
sys-devel/gcc-config:     1.6
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r1
sys-kernel/linux-headers: 3.1 (virtual/os-headers)
sys-libs/glibc:           2.14.1-r3
Repositories: gentoo vdr-devel x-portage
ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="* -@EULA AdobeFlash-10.1 cadsoft dlj-1.1 sun-bcla-java-vm"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=pentium4 -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib/fax /var/bind /var/spool/fax/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.3/ext-active/ /etc/php/cgi-php5.3/ext-active/ /etc/php/cli-php5.3/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=pentium4 -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--autounmask=n"
FCFLAGS="-O2 -march=i686 -pipe"
FEATURES="assume-digests binpkg-logs ccache config-protect-if-modified distlocks ebuild-locks fixlafiles news parallel-fetch parse-eapi-ebuild-head protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS="-O2 -march=i686 -pipe"
GENTOO_MIRRORS="ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo/"
LANG="de_DE.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="de en"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/vdr-devel /usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X acl acpi alsa berkdb bzip2 cli cracklib crypt cxx dri fortran gdbm gpm hal iconv lirc mmx mmxext modules mudflap ncurses nls nptl opengl openmp pam pcre pppd readline session sse sse2 ssl tcpd threads truetype unicode x86 xmvc xorg zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" DVB_CARDS="tda10045 tda10046" ELIBC="glibc" FRITZCAPI_CARDS="fcpci" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev mouse keyboard" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="de en" LIRC_DEVICES="serial" MISDN_CARDS="avmfritz" PHP_TARGETS="php5-3" PYTHON_TARGETS="python3_2 python2_7" RUBY_TARGETS="ruby18 ruby19" USERLAND="GNU" VIDEO_CARDS="nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 1 BT 2012-07-16 01:00:11 UTC
If you have db_dir=/var/cache/minidlna or log_dir=/var/log/minidlna in /etc/minidlna.conf then you need to make sure those directories exist and are owned by the user/group specified in /etc/conf.d/minidlna.

In previous versions MiniDLNA was run as root:root but now it's run as nobody:nobody so the daemon doesn't have the permissions to create the cache and log directories or to modify existing files in those directories.
Comment 2 snowy.mail 2012-07-18 21:20:00 UTC
Hm, okay, this seems to be the problem. In this case, an error message indicating the missing permissions would have been helpful.

Anyway, after creating a seperate directory for the db and log file, minidlna is working again.

What would be the correct solution if I still want the logfile in /var/log and the db in /var/cache?
Comment 3 Michael Weber (RETIRED) gentoo-dev 2012-07-18 21:45:51 UTC
Thanks for the report. I look into this tomorrow.
Comment 4 BT 2012-07-18 23:14:38 UTC
(In reply to comment #2)
> What would be the correct solution if I still want the logfile in /var/log
> and the db in /var/cache?

Edit /etc/conf.d/minidlna and set both M_USER and M_GROUP to "root". You also need ensure that db_dir and log_dir in /etc/minidlna.conf point to the existing locations.
Comment 5 snowy.mail 2012-07-19 19:13:01 UTC
(In reply to comment #4)

> Edit /etc/conf.d/minidlna and set both M_USER and M_GROUP to "root". You
> also need ensure that db_dir and log_dir in /etc/minidlna.conf point to the
> existing locations.

I have seen these settings (and changed the db_dir and log_dir variables). However, if minidlna would not be run as root, this would be nice due to securtity reason (probably this is why nobody:nobody is set as default)
Comment 6 BT 2012-07-19 23:39:47 UTC
> I have seen these settings (and changed the db_dir and log_dir variables).
> However, if minidlna would not be run as root, this would be nice due to
> securtity reason (probably this is why nobody:nobody is set as default)

You could let the daemon run as nobody:nobody but you would have to change the ownership of the existing files/directories to match.
Comment 7 Michael Weber (RETIRED) gentoo-dev 2012-07-20 06:13:19 UTC
Hi,

(In reply to comment #6)
> > I have seen these settings (and changed the db_dir and log_dir variables).
> > However, if minidlna would not be run as root, this would be nice due to
> > securtity reason (probably this is why nobody:nobody is set as default)
Exactly, bug 394373 convinced me - besides own considerations - to not run this program as root. I didn't want to add an user/group by default, because I run it as my own non-root account (michael:users) to access my video directories.
And I'm not a big fan of ACL, mainly because of it's missing representation in `ls -l`.

> You could let the daemon run as nobody:nobody but you would have to change
> the ownership of the existing files/directories to match.

The files.db and logfile reside in /tmp/minidlna, which is a sticky tempdir.
This can cause errors, if you change the user (update .23 -> .24) and nobody:nobody cannot access the tempdir created by root:root. Sorry, I did not consider that fact.

As far as I can see in the source code, the default file location is controlled by DB_PATH and LOG_PATH (genconfig.sh) during compile time. And it's /tmp/minidlna by default, which triggers rescans after reboot/restart [1] and thats bad on large collections.

Any objections if I 
a) add an default user/group minidlna:minidlna to the system
b) set /var/lib/minidlna/{files.db,art} owned by that user/group for cache
c) set /var/log/minidlna.log owned that user/group for logs.

These dirs are all new, so it should not make problems w/ perms on existing locations/file collisions.
I'm wondering if I need an logrotate rule to assure that ownership on the logfile.

What do you think?

   Michael


[1] http://www.pathname.com/fhs/pub/fhs-2.3.html#TMPTEMPORARYFILES
Comment 8 BT 2012-07-20 06:43:36 UTC
(In reply to comment #7)
> Any objections if I 
> a) add an default user/group minidlna:minidlna to the system
> b) set /var/lib/minidlna/{files.db,art} owned by that user/group for cache
> c) set /var/log/minidlna.log owned that user/group for logs.

No objections from me. I was hoping you were going to go this route when bug #394373 was first filed.

You should also consider that latest CVS added a config option to minidlna.conf to set the user to run as. Not sure if it's relevant to this issue though.
Comment 9 Michael Weber (RETIRED) gentoo-dev 2012-07-20 08:08:00 UTC
(In reply to comment #8)
> (In reply to comment #7)
> > Any objections if I 
> > a) add an default user/group minidlna:minidlna to the system
> > b) set /var/lib/minidlna/{files.db,art} owned by that user/group for cache
> > c) set /var/log/minidlna.log owned that user/group for logs.
> 
> No objections from me. I was hoping you were going to go this route when bug
> #394373 was first filed.
I'm in tension between having accounts for services (apache, mail, ...) and not cluttering systems user list. Anyway, I now consider this home-server service as an service like others and have no problems adding an account. Thanks for the nod.

> You should also consider that latest CVS added a config option to
> minidlna.conf to set the user to run as. Not sure if it's relevant to this
> issue though.

Cool, http://minidlna.cvs.sourceforge.net/viewvc/minidlna/minidlna/?sortby=date#dirlist , this is nice to know, it should just affect the way init.d starts the service. It does notchange above considerations.
Hopefully I remember next version bump.

+*minidlna-1.0.25-r1 (20 Jul 2012)
+
+  20 Jul 2012; Michael Weber <xmw@gentoo.org> +minidlna-1.0.25-r1.ebuild,
+  +files/minidlna-1.0.25.confd, +files/minidlna-1.0.25.initd:
+  Revbump adding minidlna user/group, adding /var/lib/minidlna and
+  /var/log/minidlna.log (bug 426726, thanks snowy.mail@gmx.net and BT), adding
+  NEWS (bug 427014, thanks Tanktalus@gmail.com)
+