<?sphp $this->text('pagetitle') ?>
 
Home of the Squeezebox™ & Transporter® network music players.

Linux Installation Guide

From SqueezeboxWiki

Revision as of 05:05, 17 September 2016 by Jan.Schmidt (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This page needs editing. Most of this info is outdated and needs to be updated for SC7.

Please note: For SlimServer 6.3.x, Version 5.6.1 or higher of Perl is required. 5.8.3 or higher is strongly recommended. For SlimServer 6.5, Perl 5.8.1 is the minimum required version.

When building Perl from scratch, be sure to enable multithreaded operation during the ./Configure step (Not the default).


Contents

Linux

The Linux RPMs install the software under /usr/local/slimserver There is one critical config file, /etc/slimserver.config There is also a /etc/sysconfig/slimserver that handles startup from /etc/rc/d/init.d

  • Note: see the RPM page if you have trouble with SlimServer 6.5 or newer RPM distributions.

The standard installation creates a non-priviledged user named "slimserver" (with its own group "slimserver) that is used to own files and directories, and is used as the login account for the slimserver daemon.

The standard RPM puts the appropriate entries in /etc/rc.d/init.d so that automated startup works as you expect.

There is a log file written to /tmp/slimserver.log This can be changed by editing the /etc/sysconfig/slimserver

If you've installed the RPM on a RedHat, MandrakeLinux, or MandrivaLinux system, you can start the server with this command:

service slimserver start

and stop it with this:

service slimserver stop

and check that the daemon is running with

service slimserver status

As part of the debugging support, if there is no /etc/slimserver.conf file, or if it is not readable when the slimserver starts, it will look for ~.slimserver.conf that is, the normally hidden file .slimserver.conf in the home directory of the current user.

If the server dies without any visible error messages, check the log file. For more verbose messages, start the program with the options of –d_source –d_stdio

To refresh the configuration parameters, you can simply delete the /etc/slimserver.conf file (or rename it to something else). This will cause the slimserver to search for the ~.slimserver.conf, and failing that, to recreate it with default values.

Centos 7

install updates

Upon logging in as root to your newly created EL7 server, run the following commands to install all of the outstanding updates, and then reboot.

yum -y upgrade shutdown -r now

install required Software

Once the machine is back up, again log in as root, and we'll install the prerequisite software packages. These packages are required either to download and install LMS, or for it to start and run properly. Because the RPM file you will download isn't specific to EL7, it doesn't automatically pull them in as dependencies, we have to install them manually.

yum -y install perl-Time-HiRes perl-CGI perl-Digest-MD5 nfs-utils wget

Download LMS

Next we'll download the LMS server package. I used version 7.8.1 for my server, which was the most recent version in the 7.8 branch at the time I installed it. The software is available on this web site (http://downloads.slimdevices.com/nightly/?ver=7.8) Although we will retrieve it using wget.

wget http://downloads.slimdevices.com/nig...076.noarch.rpm yum localinstall ./logitechmediaserver-7.8.1-0.1.1472561076.noarch.rpm

create a symlink

We have to create this symbolic link on the filesystem in order for the LMS server to start and run:

ln -s /usr/lib/perl5/vendor_perl/Slim /usr/lib64/perl5/Slim

Firewall Settings

Your EL7 server uses firewalld instead of plain old iptables like EL6 did. Here's the commands to open the required ports using firewalld:

firewall-cmd --zone=public --add-port=9000/tcp --permanent firewall-cmd --zone=public --add-port=3483/tcp --permanent firewall-cmd --zone=public --add-port=3483/udp --permanent firewall-cmd --reload

Start LMS Server

Lets start the LMS server, and set it to auto-start during bootup. EL7 uses systemd instead of the old init system, so the commands are different than they were on EL6:

systemctl start squeezeboxserver systemctl enable squeezeboxserver

Configure LMS

Now you should be able to browse to http://yourserver:9000 and begin configuring the Logitech Media Server. Congrats, you're all finished!

Optional step

If you want to enable the transcoding feature in LMS, you'll have to install the LAME MP3 encoder. The LAME software is not available in the default EL7 repositories, so you'll have to add a 3rd party repository to install it.

cd /etc/yum.repos.d/ wget http://negativo17.org/repos/epel-handbrake.repo yum -y install lame

HOWTO guide for installing Logitech Media Server on Centos 7 (also RHEL 7)


Mandriva

The current Mandriva 2006 default installations from Mandriva do not install all the needed support routines and modules needed to support a SlimServer. The prior versions did, and you can "just install the rpm" for Mandrake 10.1 and earlier. But for current systems, please see. (MandrivaLinux)

Gentoo

Squeezebox Server is now in Portage, currently marked unstable. To install it, type:

echo "media-libs/gd jpeg png" >> /etc/portage/package.use
echo "dev-perl/GD jpeg png" >> /etc/portage/package.use
echo "media-sound/sox flac" >> /etc/portage/package.use
echo "media-sound/squeezeboxserver ~x86" >> /etc/portage/package.keywords
emerge media-sound/squeezeboxserver

Please report bugs at https://bugs.gentoo.org/, or post to the Linux/Unix Slim Devices forum.

Debian/Ubuntu

There's a whole page on setting up Slimserver under Debian and Ubuntu at DebianPackage

SuSE

There have been several SuSE Linux startup scripts submitted which are linked here SuSE.

FreeBSD

SlimServer is part of ports so you can install from there.

In a normal installation of FreeBSD the version of Perl is 5.00 and not sufficient for use with the SlimServer software, which requires 5.6 or greater.

To upgrade Perl to 5.8:

First become the superuser, then issue the following commands

# cd /usr/ports/lang/perl5.8
# make install clean# rehash
# use.perl port

The Linux standard installation creates a user, slimserver, that owns all the appropriate files and is the login account for the slimserver daemon. There is no requirement that the slimserver daemon execute with extensive priviledges. As always, executing the perl programs as "root" is not good security practice.


If you aren't installing the RPM, you can start the server from a command line with the following command:

./slimserver.pl --daemon

This will start up the server and run itself in the background.

Visit the URL that's printed out with your web browser to configure your SlimServer and see the complete documentation.


Upgrading

Simple update to latest nightly

  • Download the new version:
wget http://www.slimdevices.com/downloads/nightly/latest/6.2/slimserver-x_x_x-1.noarch.rpm
  • Install the new version
rpm -Uvh slimserver-x_x_x-1.noarch.rpm

Clean update

Note: This section needs an expert's attention

  • Start downloading the new version of slimserver-x.x.x.noarch.rpm
  • Uninstall the old version - at a terminal window type:
rpm -e slimserver
  • Double-click the downloaded rpm to install it.
  • Your old configuration/preferences will have been saved during the uninstallation as /etc/slimserver.conf.rpmsave - rename this to slimserver.conf and restart the slimserver service to regain your old settings.
    • Note: some say /etc/slimserver.pref(s) is the filename

Command Line Usage Information

Usage: ./slimserver.pl [--audiodir ] [--daemon] [--stdio] [--logfile ] 
                       [--user ]
                       [--group ]
                       [--httpport  [--httpaddr ]]
                       [--cliport  [--cliaddr ]]
                       [--prefsfile  [--pidfile ]]
                       [--d_various]
                       --help           => Show this usage information.
                       --audiodir       => The path to a directory of your MP3 files.
                       --logfile        => Specify a file for error logging.
                       --daemon         => Run the server in the background.
                                           This may only work on Unix-like systems.
                       --stdio          => Use standard in and out as a command line interface
                                           to the server
                       --user           => Specify the user that server should run as.
                                           Only usable if server is started as root.
                                           This may only work on Unix-like systems.
                       --group          => Specify the group that server should run as.
                                           Only usable if server is started as root.
                                           This may only work on Unix-like systems.
                       --httpport       => Activate the web interface on the specified port.
                                           Set to 0 in order disable the web server.
                       --httpaddr       => Activate the web interface on the specified IP address.
                       --cliport        => Activate the command line interface TCP/IP interface
                                           on the specified port. Set to 0 in order disable the
                                           command line interface server.
                       --cliaddr        => Activate the command line interface TCP/IP
                                           interface on the specified IP address.
                       --prefsfile      => Specify the path to the preferences file
                       --pidfile        => Specify where a process ID file should be stored
                       --quiet          => Minimize the amount of text output
                       --playeraddr     => Specify the _server's_ IP address to use to connect
                                           to players
                       --streamaddr     => Specify the _server's_ IP address to use to connect
                                           to streaming audio sources
                       --nosetup        => Disable setup via http.

The following are debugging flags which will print various information to the console via stderr:

--d_cli          => Display debugging information for the
                    command line interface interface
--d_command      => Display internal command execution
--d_control      => Low level player control information
--d_display      => Show what (should be) on the player's display
--d_files        => Files, paths, opening and closing
--d_http         => HTTP activity
--d_info         => MP3/ID3 track information
--d_ir           => Infrared activity
--d_itunes       => iTunes synchronization information
--d_moodlogic    => MoodLogic synchronization information
--d_mdns         => Multicast DNS aka Zeroconf aka Rendezvous information
--d_os           => Operating system detection information
--d_paths        => File path processing information
--d_perf         => Performance information
--d_parse        => Playlist parsing information
--d_playlist     => High level playlist and control information
--d_protocol     => Client protocol information
--d_prefs        => Preferences file information
--d_remotestream => Information about remote HTTP streams and playlists
--d_scan         => Information about scanning directories and filelists
--d_server       => Basic server functionality
--d_scheduler    => Internal scheduler information
--d_stdio        => Standard I/O command debugging
--d_stream       => Information about player streaming protocol
--d_stream_v     => Verbose information about player streaming protocol
--d_sync         => Information about multi player synchronization
--d_time         => Internal timer information
--d_ui           => Player user interface information
--d_usage        => Display buffer usage codes on the player's display

Commands may be sent to the server through standard in and will be echoed via standard out.

See complete documentation for details on the command syntax.


slimserver 6.5.0 and 6.5.1 rescan patch

Patch for the slimserver 6.5.0 and 6.5.1 if it does not rescan the music directory


Slimserver install from the .tar.gz file

(I'm installing on an older modded Slackware system) The .tar.gz source does not seem to include any slimserver startup scripts for the init.d. Perhaps the other startup scripts shown one level up from this page can be modified..

Linux Permission Problems

Squeezecenter runs under its own user account in Linux. This means that it can't read your music library or your playlists unless its given proper permission to access the files.

Your music library is likely under your own user id, and if you want to manage it, you need to keep it that way. The easiest solution is to make sure that the library and the complete path to the library from the root are other (world) readable. This can be accomplished initially by:

cd library_top_directory
chmod -R a+rX .
repeatedly
cd ..
ls -ld .
if not at least r-xr-xr-x then
chmod a+rX .

Note that if you reach a directory that you don't own that needs changing (you shouldn't, by the way) you will need sudo or root to make the change. In that case, ask why the change is needed, since normally the path to your home directory is world readable.

And remember to fix the permissions of new music as you add it. If you add music by using samba to do your ripping on windows, you can change the samba config to set the permissions correctly for new files.

If you want your playlists under your home directory, you need to make the playlist directory world writeable. (Someone who remembers what the install default is please fix this).

Plugins can also cause permission problems. You will normally be running as root when you unzip the plugin, since the Plugin directory is owned by sqeezecenter and can't be written by your user account. It is likely that once you populate the new plugin subdirectory, it will not be readable by squeezecenter. In addition, directories may not have execute permission. To fix this:

cd Plugins
chown -R squeezecenter new_plugin_directory_name
chmod u+rX new_plugin_directory_name

Finally, see if there are any executable files. Normally, there will not be, but, for example, AlienBBC installs mplayer.sh in a subdirectory. Executable files must have at least r-x------ permissions for squeezecenter to use them. To fix a specific file:

chmod u+rx specific_file_name

while in the directory containing the file. (N.B. the first chmod uses capital X, the second lower case x. This matters).

See also this note on the issues arising from attaching an external USB drive to a Linux system: MusicOnLinuxUSBHardDrives

Other Linux Information

How to run MusicIP in headless mode on Linux: MusicMatchMixerHeadlessOnLinux