I have successfully built and am running the latest 7.9 nightly (1438870722) in a FreeBSD jail on FreeNAS FreeNAS-9.3-STABLE-201506292332 on an HP Microserver Gen8 with 10GB RAM, a 16GB flash drive, a 120GB Samsung SSD and 4 x 4TB WD Red HDs.
My goal was to have 10TB+ of lz4 storage for media and run LMS on the SSD. FreeNAS boots from the flash drive installed in the internal USB port, the SSD uses the ODD bay and SATA connector and the WD Reds are in the 4 drive trays.
I struggled with getting LMS to build working from the information in this thread and tried at least a half dozen times before I found the path. The following commands are exactly what I used as I went through the process successfully. You will have to adapt them to your directory/storage structures as appropriate. The key to getting it working was making sure the symbolic links to perl/perl5 were done/redone in both jails.
Create two jails: one to build LMS and one to run it. Use Advanced mode, enter the IPv4 default gateway and check VIMAGE.
In build_LMS jail:
In FreeNAS shell:Code:pkg update pkg upgrade pkg install bash pkg install gmake pkg install rsync pkg install nasm pkg install wget pkg install libgd mkdir /tmp/LMS cd /tmp/LMS wget http://downloads.slimdevices.com/nightly/7.9/sc/292fd1e/logitechmediaserver-7.9.0-1438870722.tgz tar xf logitechmediaserver-7.9.0-1438870722.tgz git clone https://github.com/Logitech/slimserver-vendor -b public/7.9 ln -s -f /usr/local/bin/perl5.20.2 /usr/bin/perl ln -s -f /usr/local/bin/perl5.20.2 /usr/bin/perl5 cd /tmp/LMS/slimserver-vendor/CPAN ./buildme.sh | tee /tmp/LMS/buildme.sh.log cd /tmp/LMS/logitechmediaserver-7.9.0-1438870722/CPAN/arch/5.20 cp -Rp /tmp/LMS/slimserver-vendor/CPAN/build/arch/5.20/amd64-freebsd-thread-multi . rm -rf i386-linux-thread-multi rm -rf i386-linux-thread-multi-64int rm -rf x86_64-linux-thread-multi cd .. rm -rf 5.8 rm -rf 5.10 rm -rf 5.12 rm -rf 5.14 rm -rf 5.16 rm -rf 5.18 cd /tmp/LMS tar cf logitechmediaserver-7.9.0-1438870722_with_fbsd.tar logitechmediaserver-7.9.0-1438870722
In LMS jail:Code:cp /mnt/SSD/jails/build_jail/tmp/LMS/logitechmediaserver-7.9.0-1438870722_with_fbsd.tar /mnt/SSD/jails/LMS/tmp
I created an additional storage source /mnt/SSD/lms_data with destination /mnt/lmsdata and set permissions:Code:pkg update pkg upgrade pw groupadd -n lms -g 30001 pw useradd -n lms -u 30001 -g lms -s /usr/sbin/nologin -c "Logitech Media Server" -d /nonexistent mkdir /usr/local/lms tar xf /tmp/logitechmediaserver-7.9.0-1438870722_with_fbsd.tar -C /usr/local/lms mv /usr/local/lms/logitechmediaserver-7.9.0-1438870722/* /usr/local/lms rmdir /usr/local/lms/logitechmediaserver-7.9.0-1438870722 chown -R lms:lms /usr/local/lms rm /usr/bin/perl rm /usr/bin/perl5 ln -s -f /usr/local/bin/perl5.20.2 /usr/bin/perl ln -s -f /usr/local/bin/perl5.20.2 /usr/bin/perl5
Create startup file: lmsCode:chown -R lms:lms /mnt/lms_data/cache chown -R lms:lms /mnt/lms_data/prefs
This is trickier than it looks because it can't have any extra white space. I suggest getting it here:
http://pastebin.com/download.php?i=jtuvqvEJ
Follow the instructions in the file.
Restart your jail and try to connect to http://yourjailIP:9000Code:mv lms /usr/local/etc/rc.d/ chown root:wheel /usr/local/etc/rc.d/lms chmod 555 /usr/local/etc/rc.d/lms echo 'lms_enable="YES"' >> /etc/rc.conf echo 'lms_cachedir="/mnt/lms_data/cache"' >> /etc/rc.conf echo 'lms_prefsdir="/mnt/lms_data/prefs"' >> /etc/rc.conf echo 'lms_playlistdir="/mnt/Playlists"' >> /etc/rc.conf
Results 1 to 10 of 70
-
2015-08-11, 19:02 #1
How to: Installing LMS 7.9 nightly in a FreeBSD jail on FreeNAS 9.3
Home: Win7Pro(x64)[3.3Ghz i5, 8GB RAM, 120GB SSD system, 15TB storage], LMS 7.9.0 -> Logitech Squeezebox Classic V.3 -> Cambridge Audio DacMagic -> NAD C160 -> 2 x NAD C272 -> Quad 22L2
Portable: FreeNAS 9.3 [HP Microserver Gen8, 10GB RAM, 16GB flash boot, 120GB SSD for LMS 7.9.0 in FreeBSD jail, 5 x 4TB WD Red HD ZFS RAIDZ1] -> Logitech Squeezebox Classic V.3 -> Cambridge Audio DacMagic: XLR out -> Soundmaster Diamond 12-2 mixing board -> P.A.
-
2015-08-25, 06:46 #2
- Join Date
- Aug 2012
- Location
- Austria
- Posts
- 736
While I have no clue about FreeBSD, I'm not convinced this is a good idea:
It seems you are overwriting the system perl, which could result in a number of problems (both in operation and when the system perl is upgraded)
You could have a look at the howto mentioned in my signature for a different approach (just don't build your own perl, use the one in /usr/local)
-
2015-08-26, 18:40 #3Home: Win7Pro(x64)[3.3Ghz i5, 8GB RAM, 120GB SSD system, 15TB storage], LMS 7.9.0 -> Logitech Squeezebox Classic V.3 -> Cambridge Audio DacMagic -> NAD C160 -> 2 x NAD C272 -> Quad 22L2
Portable: FreeNAS 9.3 [HP Microserver Gen8, 10GB RAM, 16GB flash boot, 120GB SSD for LMS 7.9.0 in FreeBSD jail, 5 x 4TB WD Red HD ZFS RAIDZ1] -> Logitech Squeezebox Classic V.3 -> Cambridge Audio DacMagic: XLR out -> Soundmaster Diamond 12-2 mixing board -> P.A.
-
2015-08-28, 18:28 #4
Thanks get.amped, I used your method and all is working well. My library is mostly FLAC but I did have to install the FAAD port to get any m4a tracks to transcode and play.
It runs fast and smooth - so much better than trying to run in a virtualbox jail.
What will be required to keep LMS updated?Last edited by pufnstuf; 2015-08-28 at 18:29. Reason: additional question
-
2015-08-28, 18:44 #5
I have had that same question
It should be a reduced set of the same instructions. First take a snapshot of your jails so you can revert back to them if everything goes horribly wrong. Then, in the build jail, wget the nightly, git the source, run buildme.sh, clean up the unneeded versions, tar it, cp it to the LMS jail, untar it and mv the files into usr/local/lms.
At least that's what I'm going to try when I want to get a more recent nightly. Anyone with more Linux skills than I please chime in if there's a better/easier way.
And I didn't even think about the FAAD port for m4a tracks. I don't have many (and almost never play them anyway) but I should probably go ahead and do that as well.Home: Win7Pro(x64)[3.3Ghz i5, 8GB RAM, 120GB SSD system, 15TB storage], LMS 7.9.0 -> Logitech Squeezebox Classic V.3 -> Cambridge Audio DacMagic -> NAD C160 -> 2 x NAD C272 -> Quad 22L2
Portable: FreeNAS 9.3 [HP Microserver Gen8, 10GB RAM, 16GB flash boot, 120GB SSD for LMS 7.9.0 in FreeBSD jail, 5 x 4TB WD Red HD ZFS RAIDZ1] -> Logitech Squeezebox Classic V.3 -> Cambridge Audio DacMagic: XLR out -> Soundmaster Diamond 12-2 mixing board -> P.A.
-
2015-08-29, 07:50 #6
- Join Date
- Aug 2012
- Location
- Austria
- Posts
- 736
-
2015-08-29, 08:05 #7
- Join Date
- Aug 2012
- Location
- Austria
- Posts
- 736
You only need to do the build step if the version of one of the binary CPAN modules changes, which happens very rarely (< once a year), so you can nearly always skip this step
Getting the nightly and checking out is also unnecessary, one of the two is enough. Keeping the checked out version locally (not in /tmp) and only updating (git pull) is a lot more efficient the downloading everything every time.
The most convenient way is to run LMS directly from the checked out repository (which should exclude Bin/ and CPAN/arch, where you will have your own binaries instead), then a simple git pull will bring you up to date
-
2015-08-29, 11:50 #8
Thanks for the tips. I'm slowly developing some small proficiency with this stuff. For example, I only just discovered that the directories for the group ".38 Special" wasn't getting scanned because they start with a "." which makes them hidden. Not sure if there's any way to keep the leading "." and not have it hidden, so I'm just removing the "." and moving on. Interestingly enough, the directory for the group "...And You Will Know Us By The Trail Of Dead" is not hidden.
Home: Win7Pro(x64)[3.3Ghz i5, 8GB RAM, 120GB SSD system, 15TB storage], LMS 7.9.0 -> Logitech Squeezebox Classic V.3 -> Cambridge Audio DacMagic -> NAD C160 -> 2 x NAD C272 -> Quad 22L2
Portable: FreeNAS 9.3 [HP Microserver Gen8, 10GB RAM, 16GB flash boot, 120GB SSD for LMS 7.9.0 in FreeBSD jail, 5 x 4TB WD Red HD ZFS RAIDZ1] -> Logitech Squeezebox Classic V.3 -> Cambridge Audio DacMagic: XLR out -> Soundmaster Diamond 12-2 mixing board -> P.A.
-
2015-09-29, 00:43 #9
- Join Date
- May 2005
- Location
- Grenoble, France
- Posts
- 47
Followed the tutorial step by step, just had to update the download link for the mightly build avalaible but compiles fails. Here is a copy of the last lines below. Any clues what's wrong ?
Code:/usr/local/bin/perl /usr/local/lib/perl5/5.20/ExtUtils/xsubpp -typemap /usr/local/lib/perl5/5.20/ExtUtils/typemap -typemap typemap Scan.xs > Scan.xsc && mv Scan.xsc Scan.c Please specify prototyping behavior for Scan.xs (see perlxs manual) cc -c -I/tmp/LMS/slimserver-vendor/CPAN/build/include -I/tmp/LMS/slimserver-vendor/CPAN/build/include -I/tmp/LMS/slimserver-vendor/ CPAN/build/include -I/tmp/LMS/slimserver-vendor/CPAN/build/include -I/tmp/LMS/slimserver-vendor/CPAN/build/include -I/tmp/LMS/slimse rver-vendor/CPAN/build/include -I/tmp/LMS/slimserver-vendor/CPAN/build/include -DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-al iasing -pipe -fstack-protector -I/usr/local/include -O2 -pipe -fstack-protector -fno-strict-aliasing -DVERSION=\"0.01\" -DXS_VER SION=\"0.01\" -DPIC -fPIC "-I/usr/local/lib/perl5/5.20/mach/CORE" -O2 -Wall -Wno-unused-value -Wno-format-security Scan.c ./xs/Result.xs: In function 'XS_Media__Scan__Result_size': ./xs/Result.xs:45: warning: format '%llu' expects type 'long long unsigned int', but argument 3 has type 'uint64_t' rm -f blib/arch/auto/Media/Scan/Scan.so LD_RUN_PATH="/usr/lib:/usr/local/lib" cc -shared -L/wrkdirs/usr/ports/lang/perl5.20/work/perl-5.20.3 -L/usr/local/lib/perl5/5.20/m ach/CORE -Wl,-rpath=/usr/local/lib/perl5/5.20/mach/CORE -lperl -L/usr/local/lib -fstack-protector Scan.o -o blib/arch/auto/Media/Sc an/Scan.so /tmp/LMS/slimserver-vendor/CPAN/build/include/../lib/libmediascan.a /tmp/LMS/slimserver-vendor/CPAN/build/include/../lib/ libavformat.a /tmp/LMS/slimserver-vendor/CPAN/build/include/../lib/libavcodec.a /tmp/LMS/slimserver-vendor/CPAN/build/include/../lib /libswscale.a /tmp/LMS/slimserver-vendor/CPAN/build/include/../lib/libavutil.a /tmp/LMS/slimserver-vendor/CPAN/build/include/../lib/ libexif.a /tmp/LMS/slimserver-vendor/CPAN/build/include/../lib/libjpeg.a /tmp/LMS/slimserver-vendor/CPAN/build/include/../lib/libpng .a /tmp/LMS/slimserver-vendor/CPAN/build/include/../lib/libgif.a /tmp/LMS/slimserver-vendor/CPAN/build/include/../lib/libdb.a -l m -lz -lintl /usr/bin/ld: /tmp/LMS/slimserver-vendor/CPAN/build/include/../lib/libavcodec.a(deinterlace.o): relocation R_X86_64_PC32 against `ff_ pw_4' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: final link failed: Bad value *** [blib/arch/auto/Media/Scan/Scan.so] Error code 1 Stop in /tmp/LMS/slimserver-vendor/CPAN/libmediascan-0.1/bindings/perl. make failed, aborting
-
2015-10-03, 19:31 #10
Ultimately all the problems I had making this work had to do with making sure that I was building with the right/consistent version of Perl. It's the reason for removing and recreating the symbolic links in the jails. However, I can't say that I saw error specifically like those as I fumbled my way through the process.
There's some chance that I could make my .tar of the LMS build available and it could be copied into the run jail and just work...Home: Win7Pro(x64)[3.3Ghz i5, 8GB RAM, 120GB SSD system, 15TB storage], LMS 7.9.0 -> Logitech Squeezebox Classic V.3 -> Cambridge Audio DacMagic -> NAD C160 -> 2 x NAD C272 -> Quad 22L2
Portable: FreeNAS 9.3 [HP Microserver Gen8, 10GB RAM, 16GB flash boot, 120GB SSD for LMS 7.9.0 in FreeBSD jail, 5 x 4TB WD Red HD ZFS RAIDZ1] -> Logitech Squeezebox Classic V.3 -> Cambridge Audio DacMagic: XLR out -> Soundmaster Diamond 12-2 mixing board -> P.A.