<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://hurlster.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Forked-daapd</id>
	<title>Forked-daapd - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://hurlster.com/wiki/index.php?action=history&amp;feed=atom&amp;title=Forked-daapd"/>
	<link rel="alternate" type="text/html" href="https://hurlster.com/wiki/index.php?title=Forked-daapd&amp;action=history"/>
	<updated>2026-10-13T13:13:07Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.38.4</generator>
	<entry>
		<id>https://hurlster.com/wiki/index.php?title=Forked-daapd&amp;diff=116&amp;oldid=prev</id>
		<title>Gqwill69: /* Startup Script */</title>
		<link rel="alternate" type="text/html" href="https://hurlster.com/wiki/index.php?title=Forked-daapd&amp;diff=116&amp;oldid=prev"/>
		<updated>2010-09-07T14:24:09Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Startup Script&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This package replaces mt-daapd&amp;lt;br /&amp;gt;&lt;br /&gt;
== Build ==&lt;br /&gt;
Over the last several releases of Ubuntu, mt-daapd&amp;#039;s transcoding has not worked for me out of the box. I had always been able to find a workaround (for example, for 9.04, see this post (http://ubuntuforums.org/showpost.php?p=7341087&amp;amp;postcount=3)); however, 9.10 has me totally stumped.&lt;br /&gt;
&lt;br /&gt;
In searching for a replacement, I came across forked-daapd (http://blog.technologeek.org/2009/06/12/217) (see also this firefly forum post (http://forums.fireflymediaserver.org/viewtopic.php?f=2&amp;amp;t=29772)). It does what mt-daapd does minus the web interface. I never used mt-daapd&amp;#039;s web interface, so no loss for me there.&lt;br /&gt;
&lt;br /&gt;
Note: The author has made AMD 64-bit packages available: forked-daapd (http://debian.technologeek.org/forked-daapd/) and antlr3 (http://debian.technologeek.org/antlr/). If you&amp;#039;re on i386 like me, keep reading.&lt;br /&gt;
&lt;br /&gt;
Installing forked-daapd was a challenge. Thankfully, the author was kind and patient enough to help me get it up and running. Here&amp;#039;s what it took.&lt;br /&gt;
&lt;br /&gt;
*Grab the forked-daapd package: &lt;br /&gt;
 git clone git://git.debian.org/~jblache/forked-daapd.git&lt;br /&gt;
Read the README and INSTALL files so you know what&amp;#039;s up. Panic when you read something about antlr3, discover that the stock Ubuntu version is too old, and discover that it has something to do with java. Now relax, I&amp;#039;ll walk you through it.&lt;br /&gt;
&lt;br /&gt;
*Make sure you have the other required libraries installed (and -dev variants):&lt;br /&gt;
&lt;br /&gt;
Libraries:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
glibc 2.9+ (for signalfd)&lt;br /&gt;
Avahi client libraries, 0.6.24 minimum&lt;br /&gt;
sqlite3&lt;br /&gt;
ffmpeg&lt;br /&gt;
confuse&lt;br /&gt;
libevent 1.4+&lt;br /&gt;
libavl&lt;br /&gt;
MiniXML&lt;br /&gt;
libflac (optional)&lt;br /&gt;
taglibc (optional)&lt;br /&gt;
libplist 0.15+ (optional - iTunes XML support)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*Get antlr3 packages&lt;br /&gt;
&lt;br /&gt;
I first installed the antlr3 packages from the repositories. Then I got the antlr-3.1.3.jar (http://www.antlr.org/download/antlr-3.1.3.jar). Edit /usr/bin/antlr3 and in the CLASSPATH variable replace the path to the antlr-3.1.3.jar you downloaded. Don&amp;#039;t worry about the stringtemplate.jar.&lt;br /&gt;
&lt;br /&gt;
*Grab the C libraries for antlr3 at http://antlr.org/download/C (3.1.3). Build and install with the typical&lt;br /&gt;
 ./configure --prefix=/usr ; make ; sudo make install&lt;br /&gt;
&lt;br /&gt;
*Configure and build forked-daapd&lt;br /&gt;
Assuming you got the required libraries and antlr3 packages installed, you&amp;#039;re ready to configure and build forked-daapd. Enter its directory and run autoreconf -i to build the configure script. I ran the configure script as recommended in the INSTALL: &lt;br /&gt;
 ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var --enable-flac --enable-musepack&lt;br /&gt;
Your configure options might be different depending on your needs. Run `make` and `sudo make install`.&lt;br /&gt;
&lt;br /&gt;
*Add user daapd&lt;br /&gt;
Forked-daapd will run with user daapd. I had to create the user on my system: &lt;br /&gt;
 sudo useradd -r daapd&lt;br /&gt;
I also had to make sure user daapd could read my music library. I added daapd to the group music, which has read access to my library:&lt;br /&gt;
 sudo usermod -G music daapd&lt;br /&gt;
 groups daapd&lt;br /&gt;
 (That last line just to verify.)&lt;br /&gt;
&lt;br /&gt;
*Point to your library in the conf file&lt;br /&gt;
The conf file is /etc/forked-daapd.conf. There&amp;#039;s not much to configure, just point to your music library under &amp;quot;Directories to index.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
*Create directory for database&lt;br /&gt;
The database will live in /var/cache/forked-daapd so create that directory and make daapd the owner:&lt;br /&gt;
 sudo mkdir /var/cache/forked-daapd&lt;br /&gt;
 sudo chown daapd /var/cache/forked-daapd&lt;br /&gt;
&lt;br /&gt;
*Fire up forked-daapd with: &lt;br /&gt;
 sudo /usr/sbin/forked-daapd&lt;br /&gt;
&lt;br /&gt;
If you run into issues with your Soundbridge or other device not being able to see the server, check out this post (http://ubuntuforums.org/showpost.php?p=7335637&amp;amp;postcount=7) to learn how to add the daap service to avahi. Mine was a holdover from struggling with mt-daapd.&lt;br /&gt;
&lt;br /&gt;
== Startup Script ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#! /bin/sh&lt;br /&gt;
### BEGIN INIT INFO&lt;br /&gt;
# Provides: forked-daapd&lt;br /&gt;
# Required-Start: $remote_fs $syslog&lt;br /&gt;
# Required-Stop: $remote_fs $syslog&lt;br /&gt;
# Default-Start: 2 3 4 5&lt;br /&gt;
# Default-Stop: 0 1 6&lt;br /&gt;
# Short-Description: Start forked-daapd&lt;br /&gt;
# Description: Start forked-daapd, a media server using&lt;br /&gt;
# the DAAPD protocol&lt;br /&gt;
### END INIT INFO&lt;br /&gt;
&lt;br /&gt;
# Do NOT &amp;quot;set -e&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# PATH should only include /usr/* if it runs after the mountnfs.sh script&lt;br /&gt;
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/local/bin:/usr/local/sbin&lt;br /&gt;
DESC=&amp;quot;DAAP server for media sharing&amp;quot;&lt;br /&gt;
NAME=forked-daapd&lt;br /&gt;
DAEMON=/usr/sbin/$NAME&lt;br /&gt;
DAEMON_ARGS=&amp;quot;&amp;quot;&lt;br /&gt;
PIDFILE=/var/run/$NAME.pid&lt;br /&gt;
SCRIPTNAME=/etc/init.d/$NAME&lt;br /&gt;
&lt;br /&gt;
# Exit if the package is not installed&lt;br /&gt;
[ -x &amp;quot;$DAEMON&amp;quot; ] || exit 0&lt;br /&gt;
&lt;br /&gt;
# Read configuration variable file if it is present&lt;br /&gt;
[ -r /etc/default/$NAME ] &amp;amp;&amp;amp; . /etc/default/$NAME&lt;br /&gt;
&lt;br /&gt;
# Load the VERBOSE setting and other rcS variables&lt;br /&gt;
. /lib/init/vars.sh&lt;br /&gt;
&lt;br /&gt;
# Define LSB log_* functions.&lt;br /&gt;
# Depend on lsb-base (&amp;gt;= 3.0-6) to ensure that this file is present.&lt;br /&gt;
. /lib/lsb/init-functions&lt;br /&gt;
&lt;br /&gt;
#&lt;br /&gt;
# Function that starts the daemon/service&lt;br /&gt;
#&lt;br /&gt;
do_start()&lt;br /&gt;
{&lt;br /&gt;
# Return&lt;br /&gt;
# 0 if daemon has been started&lt;br /&gt;
# 1 if daemon was already running&lt;br /&gt;
# 2 if daemon could not be started&lt;br /&gt;
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test &amp;gt; /dev/null \&lt;br /&gt;
|| return 1&lt;br /&gt;
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \&lt;br /&gt;
$DAEMON_ARGS \&lt;br /&gt;
|| return 2&lt;br /&gt;
# Add code here, if necessary, that waits for the process to be ready&lt;br /&gt;
# to handle requests from services started subsequently which depend&lt;br /&gt;
# on this one. As a last resort, sleep for some time.&lt;br /&gt;
&lt;br /&gt;
# Not really necessary, nothing else should depend on this&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#&lt;br /&gt;
# Function that stops the daemon/service&lt;br /&gt;
#&lt;br /&gt;
do_stop()&lt;br /&gt;
{&lt;br /&gt;
# Return&lt;br /&gt;
# 0 if daemon has been stopped&lt;br /&gt;
# 1 if daemon was already stopped&lt;br /&gt;
# 2 if daemon could not be stopped&lt;br /&gt;
# other if a failure occurred&lt;br /&gt;
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME&lt;br /&gt;
RETVAL=&amp;quot;$?&amp;quot;&lt;br /&gt;
[ &amp;quot;$RETVAL&amp;quot; = 2 ] &amp;amp;&amp;amp; return 2&lt;br /&gt;
# Wait for children to finish too if this is a daemon that forks&lt;br /&gt;
# and if the daemon is only ever run from this initscript.&lt;br /&gt;
# If the above conditions are not satisfied then add some other code&lt;br /&gt;
# that waits for the process to drop all resources that could be&lt;br /&gt;
# needed by services started subsequently. A last resort is to&lt;br /&gt;
# sleep for some time.&lt;br /&gt;
start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON&lt;br /&gt;
[ &amp;quot;$?&amp;quot; = 2 ] &amp;amp;&amp;amp; return 2&lt;br /&gt;
# Many daemons don&amp;#039;t delete their pidfiles when they exit.&lt;br /&gt;
rm -f $PIDFILE&lt;br /&gt;
return &amp;quot;$RETVAL&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#&lt;br /&gt;
# Function that sends a SIGHUP to the daemon/service&lt;br /&gt;
#&lt;br /&gt;
do_reload() {&lt;br /&gt;
#&lt;br /&gt;
# If the daemon can reload its configuration without&lt;br /&gt;
# restarting (for example, when it is sent a SIGHUP),&lt;br /&gt;
# then implement that here.&lt;br /&gt;
#&lt;br /&gt;
start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME&lt;br /&gt;
return 0&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
case &amp;quot;$1&amp;quot; in&lt;br /&gt;
start)&lt;br /&gt;
[ &amp;quot;$VERBOSE&amp;quot; != no ] &amp;amp;&amp;amp; log_daemon_msg &amp;quot;Starting $DESC&amp;quot; &amp;quot;$NAME&amp;quot;&lt;br /&gt;
do_start&lt;br /&gt;
case &amp;quot;$?&amp;quot; in&lt;br /&gt;
0|1) [ &amp;quot;$VERBOSE&amp;quot; != no ] &amp;amp;&amp;amp; log_end_msg 0 ;;&lt;br /&gt;
2) [ &amp;quot;$VERBOSE&amp;quot; != no ] &amp;amp;&amp;amp; log_end_msg 1 ;;&lt;br /&gt;
esac&lt;br /&gt;
;;&lt;br /&gt;
stop)&lt;br /&gt;
[ &amp;quot;$VERBOSE&amp;quot; != no ] &amp;amp;&amp;amp; log_daemon_msg &amp;quot;Stopping $DESC&amp;quot; &amp;quot;$NAME&amp;quot;&lt;br /&gt;
do_stop&lt;br /&gt;
case &amp;quot;$?&amp;quot; in&lt;br /&gt;
0|1) [ &amp;quot;$VERBOSE&amp;quot; != no ] &amp;amp;&amp;amp; log_end_msg 0 ;;&lt;br /&gt;
2) [ &amp;quot;$VERBOSE&amp;quot; != no ] &amp;amp;&amp;amp; log_end_msg 1 ;;&lt;br /&gt;
esac&lt;br /&gt;
;;&lt;br /&gt;
status)&lt;br /&gt;
status_of_proc &amp;quot;$DAEMON&amp;quot; &amp;quot;$NAME&amp;quot; &amp;amp;&amp;amp; exit 0 || exit $?&lt;br /&gt;
;;&lt;br /&gt;
#reload|force-reload)&lt;br /&gt;
#&lt;br /&gt;
# If do_reload() is not implemented then leave this commented out&lt;br /&gt;
# and leave &amp;#039;force-reload&amp;#039; as an alias for &amp;#039;restart&amp;#039;.&lt;br /&gt;
#&lt;br /&gt;
#log_daemon_msg &amp;quot;Reloading $DESC&amp;quot; &amp;quot;$NAME&amp;quot;&lt;br /&gt;
#do_reload&lt;br /&gt;
#log_end_msg $?&lt;br /&gt;
#;;&lt;br /&gt;
restart|force-reload)&lt;br /&gt;
#&lt;br /&gt;
# If the &amp;quot;reload&amp;quot; option is implemented then remove the&lt;br /&gt;
# &amp;#039;force-reload&amp;#039; alias&lt;br /&gt;
#&lt;br /&gt;
log_daemon_msg &amp;quot;Restarting $DESC&amp;quot; &amp;quot;$NAME&amp;quot;&lt;br /&gt;
do_stop&lt;br /&gt;
case &amp;quot;$?&amp;quot; in&lt;br /&gt;
0|1)&lt;br /&gt;
do_start&lt;br /&gt;
case &amp;quot;$?&amp;quot; in&lt;br /&gt;
0) log_end_msg 0 ;;&lt;br /&gt;
1) log_end_msg 1 ;; # Old process is still running&lt;br /&gt;
*) log_end_msg 1 ;; # Failed to start&lt;br /&gt;
esac&lt;br /&gt;
;;&lt;br /&gt;
*)&lt;br /&gt;
# Failed to stop&lt;br /&gt;
log_end_msg 1&lt;br /&gt;
;;&lt;br /&gt;
esac&lt;br /&gt;
;;&lt;br /&gt;
*)&lt;br /&gt;
#echo &amp;quot;Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}&amp;quot; &amp;gt;&amp;amp;2&lt;br /&gt;
echo &amp;quot;Usage: $SCRIPTNAME {start|stop|status|restart|force-reload}&amp;quot; &amp;gt;&amp;amp;2&lt;br /&gt;
exit 3&lt;br /&gt;
;;&lt;br /&gt;
esac&lt;br /&gt;
&lt;br /&gt;
:&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
[[Category:Linux]]&lt;/div&gt;</summary>
		<author><name>Gqwill69</name></author>
	</entry>
</feed>