LMS is a media server which is build for streaming music (+photo and video) throughout your house. It streams local music as well as thousands of radio stations from the internet. It supports a large number of audio formats including MP3, FLAC, WAV, Ogg, and AAC, as well as transcoding. It can stream to both software and hardware receivers, including the various Squeezebox models, as well as any media player capable of playing MP3 streams. Plugins from Logitech and third-party sources are also supported, allowing additional functionality to be added, and there is integration with Logitech's mysqueezebox.com online service which allows for streaming of paid music streaming like WIMP, Spotify, MOG and Pandora.
Logitech Media Server is open source software, released under the terms of the GNU General Public License.
Installation
First you need to install LMS. It is very easy as there is a Debian package which installs without any problems at all.
You could use the version described later (I use a nightly build - but other versions are available as well - see here: http://downloads.slimdevices.com/nightly/ - Version 10 should not be used - they are for the new Logitech equipment)
So write:
wget http://downloads.slimdevices.com/nightl ... 52_all.deb
dpkg -i logitechmediaserver_7.7.3~1342008352_all.deb
Now LMS is installed and running. Next you need to make it possible for LMS to save log files, its database and its plug-ins otherwise it won't start after a reboot. Therefore, please don't reboot until I tell you to!
Set-up a place for storing logfiles, configuration files and the LMS-database
Next you need to make a place to save these files, either you can use a connected HDD (with your data on) or use a dedicated USB stick which is only used for writing this stuff to.
Note you can't use a FAT or NTFS formatted disk, it needs to be a native linux partition like ext2, ext3 or ext4 formatted, because LMS is a pit picky about user rigths; LMS user is "squeezeboxserver" and group is "nogroup"
Therefore make a linux partition and:
1) Name the partition LMSData
2) Copy /var/lib/squeezeboxserver/ with all its subdirectories to /media/LMSData
3. Add a log directory by making a /media/LMSData/squeezeboxserver/log directory as well.
4. So now you should have /media/LMSData/squeezeboxserver/ with three subdirectories: cache, log, plugins and prefs. (See picture below)
5) Change the permissions so that the Permissions of /media/LMSData/squeezeboxserver/ and all its subdirectories is like this:
user is "squeezeboxserver" and group is "nogroup". (See picture below.)
The change in permissions can easily be done by using the XFexplorer. First highlight /media/LMSData/squeezeboxserver/ then right click on this, then choose "properties" and select "Permissions". In the field "User" choose squeezeboxserver from the drop-down list, and in the field "Group" choose nogroup from the drop-down list. In the right side choose "Recursively" and "files and folders" and then finaly click Accept - and now the permissions are set.
Change the start-up script
Then you need to tell LMS to use these directories, therefore jvb has made a new startup script which you can copy-paste into your existing Logitechmediaserver start script which for now is located in /live/cow/etc/Init.d/logitechmediaserver. You also need to delete the original content of the /live/cow/etc/Init.d/logitechmediaserver :
- Code: Select all
#!/bin/sh
#
# $Id$
#
# logitechmediaserver initscript for slimserver.pl
# This file should be placed in /etc/init.d.
#
# Original Author: Mattias Holmlund
#
# Updated By: Dan Sully, Michael Herger
#
# Modified for FoxyRoxy By: jbv 26-08-2012
#
### BEGIN INIT INFO
# Provides: logitechmediaserver
# Required-Start: $network $local_fs $remote_fs $syslog
# Required-Stop: $network $local_fs $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Startup script for the Logitech Media Server
# Description: Logitech Media Server powers the Squeezebox, Transporter and SLIMP3 network music \
# players and is the best software to stream your music to any software MP3 \
# player. It supports MP3, AAC, WMA, FLAC, Ogg Vorbis, WAV and more! \
# As of version 7.7 it also supports UPnP clients, serving pictures and movies too!"
### END INIT INFO
#
. /lib/lsb/init-functions
#set -e
DESC="Logitech Media Server"
NAME=squeezeboxserver
NEWNAME=FoxyLMS
DAEMON=/usr/sbin/$NAME
PIDFILE=/var/run/$NEWNAME.pid
SCRIPTNAME=$0
SLIMUSER=$NAME
CHARSET=utf8
SLIMOPTIONS=""
LOGDIR=/media/LMSData/squeezeboxserver/log
PREFSDIR=/media/LMSData/squeezeboxserver/prefs
CACHEDIR=/media/LMSData/squeezeboxserver/cache
# Read config file if it is present.
#if [ -r /etc/default/$NAME ]; then
# . /etc/default/$NAME
#else
# echo "*** /etc/default/$NAME missing"
#fi
echo "Name is : "$NAME
echo "NewName is : "$NEWNAME
case "$1" in
start) log_daemon_msg "Starting $NAME" $NAME
start-stop-daemon --start --quiet \
--chuid $SLIMUSER \
--pidfile $PIDFILE \
--exec $DAEMON \
--background \
--make-pidfile \
-- \
$DAEMON \
--prefsdir $PREFSDIR \
--logdir $LOGDIR \
--cachedir $CACHEDIR \
--charset=$CHARSET \
$SLIMOPTIONS
log_end_msg $?
;;
stop) log_daemon_msg "Stopping $NAME" $NAME
start-stop-daemon --oknodo --stop --quiet --pidfile $PIDFILE
log_end_msg $?
echo ""
;;
status)
status_of_proc -p $PIDFILE $NAME $NAME && exit 0 || exit $?
;;
restart|reload|force-reload)
#
# If the "reload" option is implemented, move the "force-reload"
# option to the "reload" entry above. If not, "force-reload" is
# just the same as "restart".
#
log_daemon_msg "Restarting $NAME" $NAME
start-stop-daemon --stop --quiet --pidfile $PIDFILE --signal 1
log_end_msg $?
;;
*)
echo "Usage: $0 {start|stop|status|restart|reload|force-reload}" >&2
exit 1
;;
esac
exit 0
That's it. Remember to use the correct paths in the start script described just above:
In this section of the script you need to take care of the marked three lines, so they fit your set-up:
DESC="Logitech Media Server"
NAME=squeezeboxserver
NEWNAME=FoxyLMS
DAEMON=/usr/sbin/$NAME
PIDFILE=/var/run/$NEWNAME.pid
SCRIPTNAME=$0
SLIMUSER=$NAME
CHARSET=utf8
SLIMOPTIONS=""
LOGDIR=/media/LMSData/squeezeboxserver/log
PREFSDIR=/media/LMSData/squeezeboxserver/prefs
CACHEDIR=/media/LMSData/squeezeboxserver/cache
Save all your precious work before a reboot
Now you are ready but you need to save everything therefore write:
95-create
This will create the 95-snap-squashfs with all your changes.
Now it is time for reboot and you will find that LMS is starting up, and it is time for configuring LMS for your use.
See the next post
Steen
Question and note for jvb: This tutorial is different from what we did previously. It seems not important to change anything in the server.prefs file. I think that the changes you made in the start-up script is sufficient.
I have been thinking that maybe we only need to make some symbolic links from the original directories to these new directories that can be written to
/media/LMSData/squeezeboxserver/log
/media/LMSData/squeezeboxserver/prefs
/media/LMSData/squeezeboxserver/cache
Then probably we could install LMS and keep the original Init.d/startup script , and we only needed a startup script that made these symbolic links before LMS is started.
Maybe it could even be used as a place were symbolic links easily could be defined for other programs that needed access to a writeable directory?