Premium music features :(

@elan said:
I wouldn’t go so far as to call Docker an emulator.

From my perspective we get to bring all the features of the platform to FreeBSD, without incurring the cost of maintaining a separate build which is missing features, for <1% of our users.

What are the downsides of Docker, in your view? Saying things like “it’s not native” or “it’s an emulator” isn’t super helpful. Are there resource limitations? Something else I’m missing?

And as I feared this pretty much confirms the death knell for PMS on FreeBSD. With FreeNAS 10 moving away from jails in favor of Docker this one’s as good as dead. Shame too, I really like PMS on FreeNAS/FreeBSD and hate to see development abandoned.

@TurboJailer said:

And as I feared this pretty much confirms the death knell for PMS on FreeBSD. With FreeNAS 10 moving away from jails in favor of Docker this one’s as good as dead. Shame too, I really like PMS on FreeNAS/FreeBSD and hate to see development abandoned.

I’ve not really read up on how FreeNAS are going to be implementing “docker” you may well find its done a layer on top of jails or a least the kernel level jail methods. If so then you should be able to run most existing “jails” as a docker container.

Jails are going away in FreeNAS 10. They are being replaced with iohyve for VM’s and their own implementation of Docker. Either way you’re going to have to either spin up a VM and install PMS on a iohyve supported OS or run a PMS Docker container.

I’ll stick to FreeNAS 9, I like my jails.

I have a FreeNAS 9.x box with a 4 disk raid. It can easily saturate gigabit. I brought up a poweredge 1950 (which I got for free, but ultimately can be had for about $200) running windows server 2012 r2 and hyper v. I put plex server on Windows 10 in a hyper v machine and pointed it to the friends data and compared the two. The one on win 10 is at minimum the same performance (and has gracenote, newer version, more libs) and for most things responds faster.

I understand that everyone is not going to deploy multiple computers just for a plex server, but there’s far more than one way to skin a cat.

@elan said:
What are the downsides of Docker, in your view? Saying things like “it’s not native” or “it’s an emulator” isn’t super helpful. Are there resource limitations? Something else I’m missing?

One huge downside is I need to install and maintain a docker installation on my server. It makes the deployment much harder instead of pkg install and done I would need to install docker, download the plex container, configure the network for it and so on.

My main point is that it’s more software with more problems and bugs I need to run. And this would be really annoying since I bought a plex premium pass only because it can run native on my servers.

While it is a little more to install the whole idea behind Docker is making it easy to maintain, so at the end of the day I doubt it will need much effort after the initial installs.

We have to keep in mind that if the install base is small then it will get less support, that’s just economic, you can’t blame the guys for that.

FreeBSD’s Linuxulator (Linux syscall implementation) is not 100% complete and just barely received 64bit support for 10.3-RELEASE. (OpenSolaris’s is actually more complete, if anyone was wondering who else is providing a similar feature.) There are issues you will have to deal with especially since FreeNAS will be targeting FreeBSD 10 instead of FreeBSD 11 or CURRENT which has further/ongoing improvements.

For example, how will Plex behave if you get an error when making a missing syscall? I assume it would just crash. I don’t believe we have a public document about the syscalls implemented a but a brief search shows you should expect inotify and the folllowing to fail as well:

linux: pid 51309 (dircolors): syscall dup3 not implemented
linux: pid 51310 (python3.3): syscall prlimit64 not implemented
linux: pid 51310 (python3.3): syscall sendmmsg not implemented
linux: pid 51314 (rsync): syscall utimensat not implemented
linux: pid 51395 (python3.3): syscall prlimit64 not implemented
linux: pid 51395 (python3.3): syscall epoll_create not implemented

I guess I can try to make a FreeBSD port of the Linux Plex server so people can start testing right now but I’m not very confident 10.3-RELEASE will work well.

This is really disappointing. I bought a lifetime Plex Pass the instant FreeBSD support was available.

edit: additionally, the Linuxulator or Linux Docker containers on FreeNAS would not be an emulator or a VM. The Linuxulator is an implementation of the Linux kernel inside FreeBSD. The syscalls are mapped directly onto native FreeBSD syscalls. The performance is sometimes better than native Linux.

I have a suggestion. Why not wrap all of the Gracenote libraries/features into a standalone daemon and access them via IPC or some internal API? If you compile this statically and ship it on FreeBSD you end up with a single Linux binary with a smaller scope of Linux syscalls that need to work and zero external dependencies. The only change required for FreeNAS users is to enable the Linuxulator kernel module which might already be enabled, and on vanilla FreeBSD it’s a simple fix as well.

I’ll have to speak to my contacts at iX / FreeNAS about the jail situation as I understand the migration path isn’t fully fleshed out yet, but it seems to me this would solve the missing features problem with less risk and complexity.

Please do not remove native FreeBSD support. It is one of the only reasons I purchased a plex pass. It is very disappointing to see that this is even a possibility.

I agree with feld that I would rather see the grace note features continue to be excluded rather than to see the support for the platform removed.

Please do not remove native FreeBSD support. I agree with zi, please just disable features that require Linux.

@feld said:
For example, how will Plex behave if you get an error when making a missing syscall? I assume it would just crash. I don’t believe we have a public document about the syscalls implemented a but a brief search shows you should expect inotify and the folllowing to fail as well:

The real question is how would the library making the syscall handle it as Plex uses libraries which make the syscall rather than making the syscall directly. It’s quite easy to see why inotify will fail seeing as how even though inotify is one of the lesser capable FS change notification systems available, it is still vastly better than what it available within the FreeBSD kernel. To implement the inotify system call, the developers would have to implement a real FS change notification system first. If you want more information on the subject, see my post in the freebsd forums: iNotify for FreeBSD? | Page 2 | The FreeBSD Forums

One very important advantage to remember with docker containers is the consistency of the user space. In the most recent release, we had to make a change to aid in a situation where users had installed newer packages on top of older packages, but files removed in subsequent versions of the media server were not being removed in these users’ installations. Essentially users had stale files lying around from older installations which were not a part of the current installation. Normally this would not be an issue but when the old file is a .py file and the installation contains corresponding .pyc files, python could chose to replace the .pyc file by compiling the .py file or ignoring the .pyc file entirely. This situation did happen and affected FreeBSD users more than others. A docker container, regardless of whether it were Linux or FreeBSD based, would have never had this situation in the first place!

(Sorry for the re-post, but I don’t see how to edit my previous post)

@elan. I just migrated all of my content to Plex on FreeBSD. I’ve been very happy with Plex. Until reading this thread, I was planning my next round of set top box purchases around which had the best Plex support. One of the reasons I chose to move to Plex was native FreeBSD support – “pkg install plexmediaserver” and I was done.

Native FreeBSD is key for me. A Linux or other OS solution (VM, some kind of Docker solution, etc) just means another OS that I need to maintain, secure, manage[1]. If some feature is dependent upon support outside of your control, disable that, let it be well known that it’s the upstream provider’s “Fault” and give the community information on how to request they provide that support. This is important enough that I would move to another media platform before move off of FreeBSD.

If you’re going to drop native FreeBSD support, please let me know now.

[1] Yes, I understand all of the “greatness” of containers that you can deploy and don’t have to “manage”. I have yet to see something that doesn’t take care and feeding in some way – there is no free lunch.

Note from moderator: I deleted your previous post since this supplants it. You can edit your post under the gear icon in the upper right of your post.

Add me to the list of people that also want PMS supported on FreeBSD going forward.

I only bought plex-pass because of the native FreeBSD support, so please continue to support it.

@gbooker02 said:
One very important advantage to remember with docker containers is the consistency of the user space. In the most recent release, we had to make a change to aid in a situation where users had installed newer packages on top of older packages, but files removed in subsequent versions of the media server were not being removed in these users’ installations. Essentially users had stale files lying around from older installations which were not a part of the current installation. Normally this would not be an issue but when the old file is a .py file and the installation contains corresponding .pyc files, python could chose to replace the .pyc file by compiling the .py file or ignoring the .pyc file entirely. This situation did happen and affected FreeBSD users more than others. A docker container, regardless of whether it were Linux or FreeBSD based, would have never had this situation in the first place!

I am not familiar with your role in all of this. Are you an employee of iX/FreeNAS, or a volunteer maintaining the Plex plugin? Regardless, if what you are describing is accurate the problem is that the deployment of Plex on FreeNAS is insecure. The user running the Plex processes should not have write access to the directories where Plex is installed. The only way this could happen is if the equivalent of /usr/local/share/plexmediaserver on FreeNAS is writable by the user running Plex. Without having a FreeNAS box to investigate I am going to assume that everything is owned by the “plex” user or Plex is run by “root”. On FreeBSD we are correctly installing Plex with those files owned by root:wheel and the daemon run by plex. By failing to sufficiently protect that data you are opening up the possibility of a remote attacker using a flaw to write to the filesystem to now be able to overwrite Plex code with their own malicious code and trick Plex into executing it. If you are in any way involved in Plex on FreeNAS please correct this immediately.

Correct file permissions, regardless of whether it were Linux or FreeBSD based, would have never had this situation in the first place!

(see what I did there?)

Now can we please focus on the topic at hand? Docker does not solve this problem, it merely introduces many more in an attempt to mask bad practices.

Feel free to email me directly to discuss this and I will gladly help you correct the FreeNAS plugin of Plex. Normally in FreeBSD we pre-compile .py files to .pyc before packaging, but I have intentionally avoided doing as it did not seem necessary. I may have to reconsider in light of this.

edit: it seems you’re a Plex employee which I didn’t notice at first. Please contact me outside the forums.

@feld said:
The user running the Plex processes should not have write access to the directories where Plex is installed

Replying outside of the forums is not appropriate here because you are spreading FUD and it needs to be quashed. This is not a permissions issue at all and the situation you think needs to be fixed does not exist (unless the user does something fooling to intentionally create it). You clearly don’t understood what happened at all, so let me spell it out for you:

The package had .pyc files, only but prior versions had .py files. When the new package was exacted, in some situations stale .py files remained from older installations. Python was using the .py files instead of the .pyc files and thus using older code and introducing regressions that have been fixed in the .pyc files.

No correction of permissions would have resolved this situation. And despite your claims, you are completely wrong in thinking that docker does not resolve this problem. Docker’s layering essentially create fresh installs for each and every version, so there are no stale files from older installations that can survive into a later version.

I only mentioned the replacement of the .pyc files because this is general behavior of python, as is the alternate behavior of ignoring the .pyc files entirely. Clearly if the permissions do not allow it, the .pyc files would not be replaced, but by ignoring them the effect is the same in terms of the code executed.

@feld said:
For example, how will Plex behave if you get an error when making a missing syscall? I assume it would just crash.

Dummied syscalls return ENOSYS. Unknown syscalls do the same. glibc handles ENOSYS by either setting errno (as with other syscall errors), or in some cases by falling back on another syscall that may be supported.

I don’t believe we have a public document about the syscalls implemented…
It’d be easier to look at this list of syscalls that aren’t, which is not exhaustive but gives you an idea of what to expect. There are a number of obscure or debugging-related calls, then several that were added in more recent (relatively speaking) Linux kernel versions. The only ones that I’d be concerned about are the inotify family, but while those are definitely nice to have, we handle their absence appropriately (as we would any other error in the relevant routine). So I wouldn’t expect to see any significant issues with syscall compatibility.

edit: additionally, the Linuxulator or Linux Docker containers on FreeNAS would not be an emulator or a VM. The Linuxulator is an implementation of the Linux kernel inside FreeBSD. The syscalls are mapped directly onto native FreeBSD syscalls. The performance is sometimes better than native Linux.

Since you understand that, I’m not sure what your concern about using Docker is, barring syscall compatibility issues (which we would obviously solve before shipping). Is it the initial migration?

If I didn’t care about the stability of Linux then my NAS might be running Linux on the metal now. But it’s not. There’s a reason I chose FreeBSD. Linux is ok on the desktop, but it can’t hold a torch to FreeBSD’s stability as a server. Which is what my PMS is.

So what we get now is the dilution of the stability of our PMS platform because Plex is abandoning a native FreeBSD build, and instead leaning on this whole docker fiasco to claim “FreeBSD support” when it’s nothing of the sort. Docker is becoming the systemd of the BSD world.

Supporting docker isn’t supporting FreeBSD. It’s an excuse to abandon FreeBSD and force us users to contaminate the stability of our servers by virtualizing a Linux environment and run PMS in that instead, with all the fragility and performance hits that entails (ZERO performance hit in a FreeBSD jail)

@sremick said:
If I didn’t care about the stability of Linux then my NAS might be running Linux on the metal now. But it’s not. There’s a reason I chose FreeBSD. Linux is ok on the desktop, but it can’t hold a torch to FreeBSD’s stability as a server. Which is what my PMS is.

I would love it if we could stick to actual facts, and not conjecture/speculation. There’s no evidence I’m aware of that shows that Linux is less stable as a server than FreeBSD. “Can’t hold a torch” makes it sound like Linux can barely stay booted or something, and anecdotally, my own ZFS-on-Linux has had zero kernel panics, e.g., in the 5 years I’ve been running it. It’s only gone down when the UPS died.

…this whole docker fiasco to claim “FreeBSD support” when it’s nothing of the sort. Docker is becoming the systemd of the BSD world.

That’s a very strange comparison, and I’m not sure I understand it.

force us users to contaminate the stability of our servers by virtualizing a Linux environment and run PMS in that instead, with all the fragility and performance hits that entails (ZERO performance hit in a FreeBSD jail)

If you can provide evidence of stability/performance issues, I’d love to hear about them.

Please don’t stop supporting plex on FreeBSD. I tried docker and the user experience isn’t great with the install and initial login. A vm (bhyve) isn’t great either, resources are wasted. Also the space allocated for the library is larger under Linux. (Last one might just be my settings.)

@elan said:
I wouldn’t go so far as to call Docker an emulator.

From my perspective we get to bring all the features of the platform to FreeBSD, without incurring the cost of maintaining a separate build which is missing features, for <1% of our users.

FWIW, I have to support what @elan is saying here, even though it does not align with the perspective of your average FreeBSD devotee and their always strong desire for “native apps”, since the presence of same validate their choice of OS platform and it’s always comforting to see “FreeBSD” on the supported software list for anything. Believe me, I get it.

That said, there will always be a tension between that POV and the ISV perspective, the latter of which is always trying to minimize development and support costs by porting to only those platforms which are absolutely necessary. That was what was so hugely compelling about Java - the notion of “write once, run anywhere” has always been something of a holy grail for ISVs and why Sun had such initial success with that marketing tag. It turned out to be not entirely true, or at least not true without also having to accept some serious caveats, but that doesn’t mean ISVs ever stopped wanting the chalice.

Having to do builds, qualification tests and support for multiple platforms is simply a pain in the butt, and if there were one “universal binary” that could do the job for everyone, you can bet it would be at the top of the wish list for the folks at Plex and every other software house in the world.

Well, along comes Docker. It ties all of the various disparate Linux solutions together with a reasonable ‘ABI’ standard (which goes further than binary format and system call compatibility but also applies to the overall execution, aka userland, environment) and then the folks at Plex hear that FreeNAS 10 is also going to run Docker containers in a fully compatible (boot2docker) virtualization environment and already has their official Plex container up and running, including the plexpass version (which we just added to the official /r/freenas container repo last night). What’s not to like about that? Why wouldn’t they be happy to hear we’re working to maximize their overall bang for buck? You simply have to look at it from their (or, again, any ISV’s perspective). Looking at the sheer number of platforms Plex already supports, it’s clear they already have their hands full.

Finally, I’ll just point out that this constant tension between “emulate vs port” is hardly new. Back when we first started the FreeBSD project (remember, this was the early 90’s), we really really wanted to be able to run at least two really major applications: Flash (which was ubiquitous and binary-only) and the Oracle database, something which a lot of our early enterprise customers absolutely relied on. Our only alternatives were to emulate either the Windows or the Linux versions because Adobe and Oracle, respectively, let it be known that they were NEVER going to port to FreeBSD. Just not in the cards, get over it, install Linux you guys! Well, that didn’t sit well, so a few folks suggested that maybe we could emulate just enough of Linux to run those applications, and what initially started as a crazy idea eventually morphed into the Linux emulation support that you see in FreeBSD today. It was both popular and highly controversial, of course, because “OMG we were killing all incentive to port to FreeBSD!” but it did run Flash and it did run Oracle and a lot of early FreeBSD users could never have been FreeBSD users without that capability. They had applications to run, and if we (in the development team) had been religious rather than pragmatic, they’d have just switched to Linux. Fortunately, due to the Linux emulation, they did not have to.

The problem is, that this is also where things stopped. Once the initial pain points were largely gone, the Linux emulation code stagnated and never did become a fully-fledged Linux compatible solution. There was just too much chasing of the bus necessary, as Linux itself evolved, and it was kind of a thankless task besides. There things largely rested until, finally, FreeBSD gained the ability to simply run all of Linux (any Linux) inside a virtual machine. Hurray! A much easier solution! Why chase compatibility system call by painful system call, and be forced to copy (and keep up to date) large chunks of the Linux userland into FreeBSD when we can simply run the whole thing in a neat little box, using the standard linux tools to keep that little box up to date? Easy button! If anything, virtualization has been around for so long now, FreeBSD finally catching up was nothing less than an expectation at this point.

Docker is no different - we’re just proxying the Docker remote API calls into a suitable Linux VM and bingo, done, any docker container (and there are well over 100,000 of them) can just run with zero compatibility concerns. It is, if you think about it, just another chapter in the “linux emulation” story for FreeBSD, but one writ even larger and with more application compatibility than even possible before, so it’s hard to blame the nice folks at Plex for seeing this as anything but a boon. Why wouldn’t they? Why, for that matter, wouldn’t your average FreeBSD user? They can still run their favorite OS while having full access to alternative operating systems (Linux, Windows, etc) and the applications that run (only) inside them. They don’t have to chase ISVs around with the begging bowl, hoping they’ll tackle yet another port.

I think there’s being on the right side of history and on the wrong side. Looking back in 20 years, we will wonder why we felt so strongly about “native” this and “native” that when other technologies came along and simply rendered the point moot. This may be all a bit hard to swallow now, here on the inflection point of history, but there’s no questioning that this is where things are going. PAX.

1 Like