You are here: Home » Reply

Reply To: startup script

#17808

fizze
Participant

This is weird because I’ve just reinstalled mt-daapd on Ubuntu just fine.
FIWI here’s my startup script:

#! /bin/sh

### BEGIN INIT INFO
# Provides: mt-daapd
# Required-Start: $local_fs $remote_fs $network $time
# Required-Stop: $local_fs $remote_fs $network $time
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Multithreaded DAAP music server
# Description: mt-daapd, a.k.a. Firefly Media Server, is what
# most people will understand to be an iTunes share
# server. It uses the DAAP protocol, as iTunes does,
# and supports streaming MP3 and AAC natively. It can
# make use of a number of conversion methods to expose
# Ogg and FLAC files too.
### END INIT INFO

PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/sbin/mt-daapd
NAME=mt-daapd
DESC=mt-daapd

test -x $DAEMON || exit 0

# Include mt-daapd defaults if available
if [ -f /etc/default/mt-daapd ] ; then
. /etc/default/mt-daapd
fi

set -e

stopd() {
echo -n "Stopping $DESC: "
start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid
--signal 2 --exec $DAEMON --oknodo
echo "$NAME."
counter=0
seen=0
while pidof mt-daapd >/dev/null && [ $counter -lt 15 ]; do
if [ $seen -eq 0 ]; then
echo -n "Waiting for mt-daapd to terminate..."
seen=1
fi

counter=$(($counter + 1))
echo -n "."
sleep 1
done
echo "OK, all clear."
}

startd() {
echo -n "Starting $DESC: "
start-stop-daemon --start --quiet -m --pidfile /var/run/$NAME.pid
--exec $DAEMON -- $DAEMON_OPTS 2>/dev/null
echo "$NAME."
}

case "$1" in
start)
startd
;;
stop)
stopd
;;
restart|force-reload)
stopd
startd
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|force-reload}" >&2
exit 1
;;
esac

exit 0

btw I just found out that the mt-daapd package or rather some of the javascript dependancies are broken. Not broken in a package sense, but the /playlist.html for instance doesn’t work.
To make it work again just overwrite everything in mt-daapd/admin-root with the files from a nightly unstable release for instance.