Logitech Media Server for FreeNAS 9.2.1.1

Status
Not open for further replies.

fireheadman

Dabbler
Joined
Nov 13, 2016
Messages
49
ended up recompiling slimserver against perl 5.22.1 (used ports) since 'pkg upgrade' was installing perl 5.24.x, which the nightly builds are only supporting up to perl 5.22.
Once I completed the compile and assembly of slimserver into lms, it fired right up.

Also did not perform an 'pkg upgrade' at all since perl 5.24.x was in the list.... I tried using 'pkg lock perl5', but this caused other pkgs in the upgrade list to fail the dependency check, most of the pkgs to upgrade were minor updates, so not worry too much about them, especially since this will be a jail environment.

oh, did have to use cpanm to install Scale::Image@0.11 so I could copy Scale.pm into the lms branch, details can be found here:
https://github.com/Logitech/slimserver-vendor/issues/8#issuecomment-260866895
 
Joined
Apr 16, 2016
Messages
18
I am Freenas 9.10 and did a mix of upgrade and downgrade to get sh /usr/local/etc/rc.d/lms start to work for
First I did :
ls /usr/local/lms/*.pl
I then edited all the files in the result set and replaced the shebang in each file:
#!/usr/local/bin/perl or #!/usr/bin/env perl

I ended up doing this extra editing in "/usr/local/etc/rc.d/lms":
Code:
#command_interpreter=/usr/bin/perl
command_interpreter=/usr/local/bin/perl


A much quicker fix to this would have been to add a symbol link pointing to the newer version of pearl.
ln -s -f /usr/local/bin/perl /usr/bin/perl
ln -s -f /usr/local/bin/perl /usr/bin/perl5


I then installed the missing perl package and downgraded the wrongly updated perl packages like this:
cpan App::cpanminus
cpanm CGI::Cookie
cpanm Audio::Scan@0.93
cpanm XML::Parser@2.41

Doing this for Image::Scale@0.08 did not work so I ended up work around this by editing /usr/local/lms/CPAN/Image/Scale.pm:
Code:
#our $VERSION = '0.08';
our $VERSION = '0.12';

Version 0.12 is the global Image::Scale package in Pearl so the version match will now be meet but I don't know if this is a good safe fix but then LMS fired right up without any errors. Instead of editing the /usr/local/lms/CPAN/Image/Scale.pm you could actually update the Scale.pm by replacing the file with a new. To get it I did this:

/usr/libexec/locate.updatedb
locate Scale.pm
cp /usr/local/lib/perl5/site_perl/mach/5.24/Image/Scale.pm /usr/local/lms/CPAN/Image/Scale.pm
chown lms:lms /usr/local/lms/CPAN/Image/Scale.pm

I do not think lms really need to have Scale.pm or the other CPAN bootstrapped so one could experiment with removing them instead but we get it as it is from the content of "http://djoole.free.fr/lms/lms-FreeNAS-amd64.tgz" that contains the logitechmediaserver-7.8.0-1392818344-FreeBSD. Even if you update the content to the nightly build for 7.9: http://downloads.slimdevices.com/nightly/?ver=7.9 you still need to go through all the bumps above, you even have Scale.pm bootstrapped even in /usr/local/lms/CPAN/arch/5.24/Image/Scaple.pm. You will find them all with locale Scale.pm. How to update the installation package is outlined in #60. I also updated the "/usr/local/etc/rc.d/lms" according to #21 and modified djooles installme.sh in #1 as follows:
Code:
set -e
group=lms
user=lms
installdir="/usr/local/lms"
tempdir="/tmp/"
tmpdir="/tmp/lms-freenas-amd64"
# we need the latest package to install it
#wget http://djoole.free.fr/lms/lms-freenas-amd64.tgz
cp lms-freenas-amd64.tgz $tempdir
cd $tempdir
tar xzf lms-freenas-amd64.tgz
#rm lms-freenas-amd64.tgz
version=`cat lms-freenas-amd64/VERSION`
# creation of the daemon lms user
if !(pw group show $group) > /dev/null 2>&1; then
  pw groupadd 816 -n $group 
fi
if !(pw user show $user) > /dev/null 2>&1; then
  pw useradd 816 -n $user -g $group -h - -s /bin/sh -c "Logitech Media Server" -d $installdir
fi
# and install
mkdir $installdir
cd $installdir
tar zxf $tmpdir/lms.tgz
mv -f $version/* $installdir
rmdir $version
cd $tmpdir
pkg update -f && pkg upgrade
# installing some dependencies that Logitech din't feel like provinding for Perl versions > 5.8
pkg install -y p5-DBI p5-EV p5-XML-Parser p5-HTML-Parser p5-JSON-XS p5-Digest-SHA1 p5-YAML-LibYAML p5-Sub-Name p5-Audio-Scan p5-Image-Scale p5-DBD-SQLite p5-Class-XSAccessor p5-Template-Toolkit p5-IO-Interface sox
# removing some obsoletes modules shipped with LMS preventing the server to start
# we are going to use the ones previously installed
mv /usr/local/lms/CPAN/DBD/SQLite.pm /usr/local/lms/CPAN/DBD/SQLite.pm.old
mv /usr/local/lms/CPAN/Class/XSAccessor.pm /usr/local/lms/CPAN/Class/XSAccessor.pm.old
mv /usr/local/lms/CPAN/Template.pm /usr/local/lms/CPAN/Template.pm.old
#remove line below if updating to lms 7.9 else keep it for lms 7.8
#mv /usr/local/lms/CPAN/Compress/Raw/Zlib.pm /usr/local/lms/CPAN/Compress/Raw/Zlib.pm.old
# installing the Media::Scan module compiled by your servitor
mkdir -p $installdir/CPAN/arch/5.16/amd64-freebsd-thread-multi/auto/Media/Scan
cp Scan.so $installdir/CPAN/arch/5.16/amd64-freebsd-thread-multi/auto/Media/Scan/
chown -R $user:$group $installdir
# service install
cp lms /usr/local/etc/rc.d
chmod +x /usr/local/etc/rc.d/lms
# autostart at boot
if ! fgrep -q lms_enable /etc/rc.conf; then
 echo 'lms_enable="YES"' >> /etc/rc.conf
fi
#restore links so perl scripts with old shebang will still work
ln -s -f /usr/local/bin/perl /usr/bin/perl
ln -s -f /usr/local/bin/perl /usr/bin/perl5
#update cpanlist
cpan App::cpanminus
#add missing cpan
cpanm CGI::Cookie
#downgrade cpan
cpanm Audio::Scan@0.93
cpanm XML::Parser@2.41
# LMS start
sh /usr/local/etc/rc.d/lms onestart
cat <<EOF
=================================================
Okay, $version is installed in your jail!
It has been configured to auto start at boot, and has been already launched for an instant use.
Just browse to http://your_jail_ip:9000
You can manually stop/start LMS with :
  service lms onestop/onestart
You can now delete your tmp dir!
=================================================
EOF



either way was fine when I did
sh /usr/local/etc/rc.d/lms restart
For some reason I cant do service lms restart due to regexp errors if on 7.8 - but anyhow I can start/stop using the lms script above so I do not care. But with the nightly build for 7.9 I could restart the service using service lms restart without the regexp errors.

I hope this help someone, take care.
 
Last edited:
Joined
Apr 16, 2016
Messages
18
Are you guys doing anything to avoid unintended uid/gid collisions when the script creates the lms user? lms immediately collided with a normal non-jail user when I ran the script based on the steps above. Perhaps updating /etc/pw.conf (saw that reference here: https://bugs.FreeNAS.org/issues/1611)? For plugins like transmission I see that the plug does pick a value out of the normal range but I didn't look into how that's accomplished. Is there a standard pattern for doing it manually in plugin jails?

I did a modifications of my own to the installme.sh script that could be of use for anyone else
Code:
# creation of the daemon lms user
if !(pw group show $group) > /dev/null 2>&1; then
  #pw groupadd $group
  pw groupadd 816 -n $group
fi
if !(pw user show $user) > /dev/null 2>&1; then
  #pw useradd $user -g $group -h - -s /bin/sh -c "Logitech Media Server" -d $installdir
  pw useradd 816 -n $user -g $group -h - -s /bin/sh -c "Logitech Media Server" -d $installdir
fi

uid/gid 816 is what is commonly used by many applications as the 'media' user. That change makes it more easy to manage credentials for your archive.

Take it or leave it.
 
Last edited:

Peacebrother

Dabbler
Joined
Sep 24, 2013
Messages
20
Hi at all,

i have still a problem with Image::Scale.

I got the following failure:
Code:
The following CPAN modules were found but cannot work with Logitech Media Server  :
  Image::Scale (loaded 0.11, need 0.08)


In all Scale.pm Files, i have changed the Version to 0.11 and i already got the version needet 0.08!

Code:
/usr/local/lib/perl5/site_perl/mach/5.24/Image/Scale.pm
/usr/local/lms/CPAN/arch/5.22/i386-linux-thread-multi-64int/auto/Image/Scale.pm
/usr/local/lms/CPAN/arch/5.24/Image/Scale.pm
/usr/local/lms/CPAN/arch/5.20/arm-linux-gnueabihf-thread-multi-64int/Image/Scale.pm
/usr/local/lms/CPAN/Image/Scale.pm
/root/.cpanm/work/1481143611.59819/Image-Scale-0.08/blib/lib/Image/Scale.pm
/root/.cpanm/work/1481143611.59819/Image-Scale-0.08/lib/Image/Scale.pm
/root/.cpan/build/Image-Scale-0.13-18Pgrd/blib/lib/Image/Scale.pm
/root/.cpan/build/Image-Scale-0.13-18Pgrd/lib/Image/Scale.pm


I'm a little bit frustrated, after a few hours of trying :-(

Does anybody had a idea what my failure is?

I use FreeNAS-9.10.1-U4

Than you
 

fireheadman

Dabbler
Joined
Nov 13, 2016
Messages
49
Here is what I did to get it working....

cpan App::cpanminus
cpanm Image::Scale@0.11 <-- Installed correct version
/usr/libexec/locate.updatedb <-- update locate DB
locate Scale.pm <-- search and sift for location of where Scale.pm (for 0.11)
cd /usr/local/lms/CPAN/Image <-- goto Scale.pm (0.08) location
mv Scale.pm Scale.pm.0.08 <-- just in case, preserve old version
cp /root/.cpanm/work/1479277874.49469/Image-Scale-0.11/lib/Image/Scale.pm . <-- copy new version over
chown lms Scale.pm
chmod 600 Scale.pm
service lms restart <-- restart LMS, looks good!

Hi at all,

i have still a problem with Image::Scale.

I got the following failure:
Code:
The following CPAN modules were found but cannot work with Logitech Media Server  :
  Image::Scale (loaded 0.11, need 0.08)


In all Scale.pm Files, i have changed the Version to 0.11 and i already got the version needet 0.08!

Code:
/usr/local/lib/perl5/site_perl/mach/5.24/Image/Scale.pm
/usr/local/lms/CPAN/arch/5.22/i386-linux-thread-multi-64int/auto/Image/Scale.pm
/usr/local/lms/CPAN/arch/5.24/Image/Scale.pm
/usr/local/lms/CPAN/arch/5.20/arm-linux-gnueabihf-thread-multi-64int/Image/Scale.pm
/usr/local/lms/CPAN/Image/Scale.pm
/root/.cpanm/work/1481143611.59819/Image-Scale-0.08/blib/lib/Image/Scale.pm
/root/.cpanm/work/1481143611.59819/Image-Scale-0.08/lib/Image/Scale.pm
/root/.cpan/build/Image-Scale-0.13-18Pgrd/blib/lib/Image/Scale.pm
/root/.cpan/build/Image-Scale-0.13-18Pgrd/lib/Image/Scale.pm


I'm a little bit frustrated, after a few hours of trying :-(

Does anybody had a idea what my failure is?

I use FreeNAS-9.10.1-U4

Than you
 

Peter Murray

Cadet
Joined
Dec 26, 2016
Messages
2
Thanks....

I am on 9.10.2 and since perl is 5.24 I also had to fix the local issue and a parse error:
Starting lms resulted in the following:
Code:
 
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\${ <-- HERE (.*?)}/ at /usr/local/lms/CPAN/Log/Log4perl/Config/PropertyConfigurator.pm line 60.
Change line 60 to the following:
		# Substitute any variables
			$val =~ s/\$\{(.*?)\}/


The local issue was fixed by another with :
Code:
ms_start_precmd() {
  if [ ! -d "/var/run/$name" ]; then
  mkdir /var/run/$name
  fi
  export LANG=en_US.UTF-8
  locale
  chown $user:$group /var/run/$name }


And I'm up and running.. many thanks to all on this thread!
 

Peter Murray

Cadet
Joined
Dec 26, 2016
Messages
2
Server is working. Connecting to devices and will play from browser to device but the Scan is not working. Log has the following:
Code:
[16-12-26 14:03:51.5733] main::init (369) Starting Logitech Media Server (v7.8.0, 1392818344, Sat Mar  1 19:18:15 PST 2014) perl 5.024001

root@LogitechMediaServer:/usr/local/lms10 # [16-12-26 14:03:53.2322] Slim::Utils::Misc::msg (1311) Warning: [14:03:53.2317] Can't locate auto/IO/Interface/autosplit.ix in @INC (@INC contains: /usr/local/lms10/Cache/InstalledPlugins/Plugins/SongLyrics/lib /usr/local/lms10/Cache/InstalledPlugins /usr/local/lms10/CPAN/arch/5.24/amd64-freebsd-thread-multi /usr/local/lms10/CPAN/arch/5.24/amd64-freebsd-thread-multi/auto /usr/local/lms10/CPAN/arch/5.24.1/amd64-freebsd-thread-multi /usr/local/lms10/CPAN/arch/5.24.1/amd64-freebsd-thread-multi/auto /usr/local/lms10/CPAN/arch/amd64-freebsd-thread-multi /usr/local/lms10/lib /usr/local/lms10/CPAN /usr/local/lms10 /usr/local/lib/perl5/site_perl/mach/5.24 /usr/local/lib/perl5/site_perl /usr/local/lib/perl5/5.24/mach /usr/local/lib/perl5/5.24 .) at /usr/local/lib/perl5/5.24/AutoLoader.pm line 181.

at /usr/local/lms10/CPAN/IO/Interface.pm line 12.

[16-12-26 14:03:54.3460] Slim::Web::Cometd::handler (422) errorNeedsClient: 00:04:20:23:33:ca, status, -, 10, menu:menu, useContextMenu:1, subscribe:600


It seems like the SQLite is not running.

Any help appreciated.
 
Last edited:

Jussi

Dabbler
Joined
Jul 1, 2016
Messages
24
I tried to install Logitech Media Server to a jail in FreeNAS-9.10.2-U3.

I downloaded the package:
wget http://djoole.free.fr/lms/lms-freenas-amd64-7.8.0-1342011222.tgz

After unpacking:

root@OpenVPN:/usr/local/tmp/lms-freenas-amd64-7.8.0-1342011222 # ./installme.sh
Starting lms.
/usr/local/lms/slimserver.pl: not found
/usr/local/etc/rc.d/lms: WARNING: failed to start lms

What is wrong? Help would be appreciated.
 

Jussi

Dabbler
Joined
Jul 1, 2016
Messages
24
I managed to build LMS (Squeezeboxserver) using these instructions: http://wiki.slimdevices.com/index.php/FreeBSD_installation_guide

However, Squeezeboxserver refuses to start:

root@OpenVPN:/usr/local/etc/rc.d # ./squeezeboxserver start
Starting squeezeboxserver.
$[ used in numeric lt (<) (did you mean $] ?) at /usr/local/squeezeboxserver/CPAN/IO/String.pm l ine 82.
Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\$ { <-- HERE (.*?)}/ at /usr/local/squeezeboxserver/CPAN/Log/Log4perl/Config/PropertyConfigurator. pm line 60.
The following CPAN modules were found but cannot work with Squeezebox Server:
CGI::Cookie (loaded <not found>, need 1.27)
Log::Log4perl (loaded <not found>, need 1.23)

To fix this problem you have several options:
1. Install the latest version of the module(s) using CPAN: sudo cpan Some::Module
2. Update the module's package using apt-get, yum, etc.
3. Run the .tar.gz version of Squeezebox Server which includes all required CPAN modules.

Undefined subroutine &Log::Log4perl::Logger::cleanup called at /usr/local/squeezeboxserver/CPAN/ Log/Log4perl.pm line 5.
END failed--call queue aborted at /usr/local/squeezeboxserver/slimserver.pl line 135.
./squeezeboxserver: WARNING: failed to start squeezeboxserver


Looks like there are version conflicts. Any advice?
 

Jussi

Dabbler
Joined
Jul 1, 2016
Messages
24
I tried to install Logitech Media Server to a jail in FreeNAS-9.10.2-U3.

I downloaded the package:
wget http://djoole.free.fr/lms/lms-freenas-amd64-7.8.0-1342011222.tgz

After unpacking:

root@OpenVPN:/usr/local/tmp/lms-freenas-amd64-7.8.0-1342011222 # ./installme.sh
Starting lms.
/usr/local/lms/slimserver.pl: not found
/usr/local/etc/rc.d/lms: WARNING: failed to start lms

What is wrong? Help would be appreciated.

I found the first problem. Perl is not in /usr/bin/perl but in /usr/local/bin/perl.

Next problem:


Unescaped left brace in regex is deprecated, passed through in regex; marked by <-- HERE in m/\${ <-- HERE (.*?)}/ at /usr/local/lms/CPAN/Log/Log4perl/Config/PropertyConfigurator.pm line 60.
The following CPAN modules were found but cannot work with Logitech Media Server:
Audio::Scan:
Audio::Scan object version 0.98 does not match bootstrap parameter 0.93 at /usr/local/lib/perl5/5.24/mach/DynaLoader.pm line 210.
Compilation failed in require at (eval 57) line 1.
BEGIN failed--compilation aborted at (eval 57) line 1.

Class::Inspector (loaded 1.24, need 1.16)
DBIx::Class (loaded <not found>, need 0.08112)
Image::Scale (loaded but missing object file, need 0.08)
Log::Log4perl (loaded <not found>, need 1.23)
XML::Parser:
Parser.pm and Expat.pm versions don't match at /usr/local/lms/CPAN/XML/Parser.pm line 20.
BEGIN failed--compilation aborted at /usr/local/lms/CPAN/XML/Parser.pm line 22.
Compilation failed in require at (eval 143) line 1.
BEGIN failed--compilation aborted at (eval 143) line 1.


To fix this problem you have several options:
1. Install the latest version of the module(s) using CPAN: sudo cpan Some::Module
2. Update the module's package using apt-get, yum, etc.
3. Run the .tar.gz version of Logitech Media Server which includes all required CPAN modules.

Undefined subroutine &Log::Log4perl::Logger::cleanup called at /usr/local/lms/CPAN/Log/Log4perl.pm line 5.
END failed--call queue aborted at /usr/local/lms/slimserver.pl line 141.
./lms: WARNING: failed to start lms
 

Jussi

Dabbler
Joined
Jul 1, 2016
Messages
24
If somebody is interested, I managed to get LMS working using these instructions:

https://forums.freenas.org/index.ph...build-and-install-lms-7-9-from-scratch.27161/

Except the package I used was: http://downloads.slimdevices.com/LogitechMediaServer_v7.9.0/logitechmediaserver-7.9.0.tgz
And the version is currently 5.24 instead of 5.20 in the instructions. And the /usr/local/etc/rc.d/lms was this: http://pastebin.com/download.php?i=jtuvqvEJ as adviced in these instructions: http://forums.slimdevices.com/showt...-7-9-nightly-in-a-FreeBSD-jail-on-FreeNAS-9-3
 

enry

Dabbler
Joined
Apr 10, 2016
Messages
21
I'm just wondering if there is any "added value" that LMS offers vs. for example Plex? I googled LMs but couldn't find much info except this site: http://www.mysqueezebox.com/index/Home

LMS is a really simple and open source protocol that works with legacy Logitech hardware plus some open source audio players. I've been using it for probably close to 15 years and as long as my hardware keeps working I'll continue to use it. Plex isn't a bad choice but probably doesn't work with arbitrary hardware for playing music.
 
Status
Not open for further replies.
Top