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.