Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 230917 - [init.d] media-sound/mt-daapd init script doesn't work with openrc
Summary: [init.d] media-sound/mt-daapd init script doesn't work with openrc
Status: RESOLVED WORKSFORME
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Sound Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-06 09:40 UTC by Sok Ann Yap
Modified: 2010-01-25 16:27 UTC (History)
2 users (show)

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


Attachments
Fixes init script to correctly acquire service name. (mt-daapd.patch,474 bytes, patch)
2010-01-15 17:37 UTC, Trevor Summers Smith
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sok Ann Yap 2008-07-06 09:40:40 UTC
The init script for mt-daapd has references to ${myservice}, which I believe doesn't exist anymore in openrc (correct me if I am wrong). Thus, the code block that checks for multiple configurations will always fall back to the default one.

Also, I need to remove "--pidfile ${PIDFILE}" from the start-stop-daemon command within start(), else it will complain about:

 * start-stop-daemon: did not create a valid pid in `/var/run/mt-daapd.pid'
 * ERROR: mt-daapd failed to start

although process did get started.

Reproducible: Always

Steps to Reproduce:
1. install mt-daapd and openrc
2. /etc/init.d/mt-daapd start (gives error about the pid)
3. /etc/init.d/mt-daapd.test start (still use the default conf)
Comment 1 Samuli Suominen (RETIRED) gentoo-dev 2009-05-12 09:33:47 UTC
We accept patches ;-)
Comment 2 Trevor Summers Smith 2010-01-15 17:37:22 UTC
Created attachment 216621 [details, diff]
Fixes init script to correctly acquire service name.

This patch fixes the init script to work with OpenRC (I tested version 0.6.0) on both single and multiple instances of mt-daapd. 

I could not recreate the pid error, but observed the pid file being created and destroyed correctly for single and multiple instances of the server (both in baselayout 1 and 2). So I am assuming that the pid error was fixed elsewhere or incorrectly reported.

N.B. the patch uses the temporary method discussed in bug #270646 to detect OpenRC.
Comment 3 Trevor Summers Smith 2010-01-25 16:12:04 UTC
My notes on attempting to reproduce the PID bug (with no success):

I tested with OpenRC 0.6.0. 

Because there is no package version information on this bug, I checked out the ebuilds which were available on 2008-07-06. This is mt-daapd-0.2.4.1 and mt-daapd-0.2.4.2. I could not reproduce the bug with either package(the pid was successfully created). 

There are patches in the package that allows the program to correctly create a pid file, however these were submitted a good deal in time before 2008-07-06. I would have to assume that the reporter was using a very old version of the package (even at the time of posting), or this involves a very old bug of OpenRC , which has now been fixed. 

I would argue there are probably better things to do than emerge very old versions of OpenRC (no longer in current tree) and test them against very old versions of mt-daapd (no longer in current tree) to reproduce this particular bug.

Thoughts? 
Comment 4 Patrick Lauer gentoo-dev 2010-01-25 16:15:02 UTC
Thanks for the detective work :)
Comment 5 Patrick Lauer gentoo-dev 2010-01-25 16:27:34 UTC
+  25 Jan 2010; Patrick Lauer <patrick@gentoo.org> files/mt-daapd.init.2:
+  Fixing init script for #230917

Actually fixing things is more fun!