Plex Media Server for FreeBSD

server-freebsd

#1

It's been requested often, and now we're releasing an experimental version for you to enjoy. Caveats:

  • This is a totally experimental release. It might be the last thing we ever do for FreeBSD.

  • We've built against FreeBSD 9.1 for "amd64". Please don't request one of the thousand other arches/versions.

  • There is no support for automatically scanning when directory content changes.

In order to run, just set LD_LIBRARY_PATH appropriately, and run the media server. If you are running FreeBSD, you know how to do this :)


 


http://www.plexapp.com/elan/PlexMediaServer-0.9.7.23.0-8e6b2a8.tar.bz2


 


EDIT (ZiGGiMoN): If your looking for a ports package to install Plex Media Server with, go here: https://github.com/KalleDK/plexmediaserver_port


#2

Hell froze over. After bugging you so much, let me be the first one to thank you. Thank you so much! You're awesome. And you've got yourself a new PlexPass subscriber.

Cheers,

-joe

PS:  I assume you're talking about FreeBSD stable9.1 (the development branch of FreeBSD 9-STABLE)?


#3

S:  I assume you're talking about FreeBSD stable9.1 (the development branch of FreeBSD 9-STABLE)?

Ooops, sorry, you're right. It's 9.1 :)


#4

And another PlexPass subscriber, just for this!  :D Thank you very much!


#5

Aaaand, I bought a plexpass account.

It might be the last thing we ever do for FreeBSD.

Please, don't. FreeBSD has the best ZFS support. ZFS is by far the best FS to store your media. Hence, Plex ought to have a FreeBSD server version. Period!


#6

Anyone else who has it running yet? At first I got an error, but when trying it again it started. I'm using screen, because I can't start it as a daemon. For some reason it doesn't save anything. When I stop the server, it starts completely blanc, when I start it again.


#7

This is great news. There are many out there, including myself, who see a Nas4Free/PMS combo as an ideal setup. 

I have limited freeBSD skills, but I plan on testing it out and providing some feedback that might be useful for others. I suggest as a community we pool together our knowledge and experience to help make this freeBSD port a success. 


#8

This is interesting. Too bad I use freeNAS and its still based on FreeBSD 8.3

Would love to see a FreeNAS PBI plugin for this, and then my server can actually run my Plex server.

Thanks anyways for the great work!


#9

Works perfectly fine. It's busy scanning my media, I was able to watch the first content without problems. Nice!


#10

Just a FYI, this is running gloriously..  I had been running the windows server over samba (ugh) for a while. I took a copy of the database from the windows machine (which was running both the client and server) and tweaked it to have the correct paths when running natively.  I wasn't sure if the pathnames would be correctly matched up or not and didn't want to find out the hard way.

Obviously the Amazon and Netflix transcoder channel plugins can't work, but everything else seems to be working fine including remote access.

I did have to comment out the LC_ALL, LANG and ulimit lines from the start.sh script in the bundle.  The ulimit line shrinks the stack way below the defaults, and LANG/LC_ALL upset a boost library.

@TazgodX: it looks like there is a 9.1 based FreeNAS release scheduled "soon".  It should be fairly simple mechanics to have somebody wrap this in a pbi once they have something to run.


#11

Following peterwemm's advice for commenting out some of the lines, I was able to get it up and running quite easily in a VM.

Does anyone have experience with nas4free, particularly using the embedded version and how one might begin getting this setup in such an environment?


#12

Dear Mods/Staff: What would be the most appropriate place in this forum to ask questions (and later on post some stuff I'm working on) regarding Plex/FreeBSD?

Cheers,

-joe


#13

Following peterwemm's advice for commenting out some of the lines, I was able to get it up and running quite easily in a VM.

Does anyone have experience with nas4free, particularly using the embedded version and how one might begin getting this setup in such an environment?

NAS4Free 9.1.0.1 is based on FreeBSD 9.1 so you should be able to install it the same way as on a regular FreeBSD. Keep in mind, PMS requires lang/python27 to be installed to function properly. Otherwise it complains (rightfull) about a missing libpython2.7.so and simply symlinking libpython2.7.so.1 provided by Plex wont work. Plex won't scan any media then.

An addition to the usefull info of peterwemm: If PMS still complains after commenting out LC_ALL and LANG, just set LC_ALL and LANG to "C" instead of commenting it out.

Cheers,

-joe


#14

Keep in mind, PMS requires lang/python27 to be installed to function properly. Otherwise it complains (rightfull) about a missing libpython2.7.so and simply symlinking libpython2.7.so.1 provided by Plex wont work. Plex won't scan any media then.

Hmm, that shouldn't be the case, we bundle Python + a few site additions. As long as LD_LIBRARY_PATH is set with absolute path, Python should find the bundled Python.


#15

Dear Mods/Staff: What would be the most appropriate place in this forum to ask questions (and later on post some stuff I'm working on) regarding Plex/FreeBSD?

If it takes off, we'll add a forum for FreeBSD specifically. For now, feel free to just post threads here in the preview release forum :)


#16

Argh reading this on my way to a 12 hour work shift... So exicted, but have to wait until I get home.


#17

Keep in mind, PMS requires lang/python27 to be installed to function properly. Otherwise it complains (rightfull) about a missing libpython2.7.so and simply symlinking libpython2.7.so.1 provided by Plex wont work. Plex won't scan any media then.

Something is odd.  Everything seems to want to use the built-in libpthon.. but..

# lsof -p 82854 | grep libpython
Plex\x20M 82854 plex  txt     VREG       5,2858680465  5234195    7126 /home/plex/PlexMediaServer-0.9.7.23.0-8e6b2a8/libpython2.7.so.1

The built-in version works fine if $LD_LIBRARY_PATH is set correctly.

Something is a little weird for sure though.  Automated scans were not working so I sniffed around a bit.

The server would run this:

May 01, 2013 00:52:04 [0x8085f2000] DEBUG - Job running: /home/plex/PlexMediaServer-0.9.7.23.0-8e6b2a8/Plex Media Scanner --scan --refresh --section 1

But all that made it the Plex Media Scanner.log file was:

May 01, 2013 00:49:02 [0x807807400] DEBUG - Opening 10 database sessions to library, SQLite 3.7.15.2, threadsafe=1

If I looked at stderr I saw some telltales from the scanner when run from the GUI:

Could not find platform independent libraries
Could not find platform dependent libraries
Consider setting $PYTHONHOME to [:]
ImportError: No module named site

I cheated and wrapped the binary:

plex@silo:~/PlexMediaServer % pwd
/home/plex/PlexMediaServer-0.9.7.23.0-8e6b2a8

plex@silo:~/PlexMediaServer % ls -l Plex\ Media\ Scanner*
-rwxr-xr-x  1 plex  plex      165 May  1 00:51 Plex Media Scanner
-rwxr-xr-x  1 plex  plex  2958968 Apr 29 18:26 Plex Media Scanner.bin

I renamed the scanner to have a .bin suffix and made a wrapper with:


plex@silo:~/PlexMediaServer % cat Plex\ Media\ Scanner
#! /bin/sh
P=/home/plex/PlexMediaServer-0.9.7.23.0-8e6b2a8
cd $P
export LD_LIBRARY_PATH=$P
export PYTHONHOME=$P/Resources/Python
exec $P/Plex\ Media\ Scanner.bin $*
 

After that, automated and GUI-triggered scans are working again.

If I had to guess, I'd suspect we (FreeBSD) did something unusual with environment variable handling that is upsetting the job spawning.


#18

The built-in version works fine if $LD_LIBRARY_PATH is set correctly.

Well, I've installed Plex in a new jail (from a fairly recent buildworld) with no other ports installed and got this: http://pastebin.ca/2370557

After symlinking libpython2.7.so.1 to libpython2.7.so Plex quits complaining, but doesn't scan anything. Installing Python (and removing the symlink to libpython2.7.so) fixes that.

But speaking of scanning media, this is also acting a little strange. Assume the following: I've added /tank/movies to a new movie-category (default settings, nothing fancy).

/tank/movies contains /tank/movie/AwesomeMovie/AwesomeMovie.avi  and /tank/movies/AnotherMovie.avi

For some reason, AwesomeMovie.avi gets scanned, but AnotherMovie.avi does not. AnotherMovie.avi gets scanned as soon as I move it into a subfolder. Why's that? (Didn't try the cheat of peterwemm yet)

Cheers,

-joe


#19

For some reason, AwesomeMovie.avi gets scanned, but AnotherMovie.avi does not. AnotherMovie.avi gets scanned as soon as I move it into a subfolder. Why's that? (Didn't try the cheat of peterwemm yet)

Cheers,

-joe

That should be okay according to the naming convention wiki.  Maybe it does not like if you mix naming conventions? 


#20

Oh man thank you. And just minutes after I posting how amazed I was by the fact that Plex just keeps getting more and more awesome.  One of the main reasons (other then because the dev's really deserve it) I got a Plexpass was to ask for BSD support.  Thank you for making my day now I beg of you keep at it. I got to warn you I may just have to buy another PlexPass if you keep doing such awesome work! :)