Plex Media Server plugin for unRAID (v0.3 - Aug 7 2011)


Recommended Posts

Last Update: August 7, 2011

v0.3. Please note of the changes that affect the way Plex is started. This is especially important if you have Plex in your /boot/config/go to auto-start on startup.


 

 

Hello Everyone,

 

For the past few weeks I have been working on developing a Plex plugin for unRAID that will greatly simplify the process of getting Plex Media Server up and running on your unRAID (v5.0 and greater) boxes. I am happy to announce that the day has come to share it with my fellow unRAID-ers out there. There is still some work to do, but hopefully this will help people get up and running pretty quickly with an oh-so-nice gui to control PMS from your unRAID web interface

 

Let's get to it!

 

Features

 

  • Simple to install unRAID package, just drop and go!
  • GUI interface to configure Plex Media Server on your unRAID box
  • Start / Stop / Manage your Plex Media Server directly from the default unRAID gui
  • Two versions of the plugin. A "Full" version that includes Plex v0.9.3.5-c3e763f and a "Light" version that does not.

 

Current Limitations

 

  • You must manually start/stop Plex Media Server upon booting/shutting down your unRAID box.

 

Requirements

 

  • unRAID v5.0-beta10 (untested on previous 5.0 betas). Will not work on v4.
  • Plex v0.9.3.5-c3e763f (if using the Light version).
  • Optional: Simple features plugin by speeding_ant (makes your unRAID 5.0 gui look uber-sexy). Available at http://lime-technology.com/forum/index.php?topic=12698.0

 

Installation

 

  • Download either the Full or Light version (link below)
  • Put the downloaded file on your USB drive in the extra folder (create if necessary). If you want to do this directly from your Windows/Mac PC, you would copy it to the "flash" share in the "extra" directory.
  • Reboot your unRAID server OR open a telnet session, type "cd /boot/extra" and then "installpkg plex-<version>-i386-unRAID.tgz" or "installpkg plexlight-<version>-i386-unRAID.tgz" depending on the version you have downloaded.

 

For Light Version

Download Plex from the official website and extract the .bz2 file somewhere on your array. Remember where you have installed it as you will need it for the configuration steps below. You will still need to put plexlight-<version>-i386-unRAID.tgz in your flash/extra folder.

 

Configuration

 

Once the plugin has been installed, follow the next steps in order to configure Plex Media Server on your system.

 

  • Go to your unRAID gui, click on "Utils" and you will see an icon for "Plex Media Server". Alternatively, you can go to http://unraid_ip/Utils/Plex. If you see errors indicating folders do not exist/etc, don't worry, this is normal on first launch
  • Configure your settings:
  • Installed Directory: Enter the path where you have extracted the official Plex release. This is not necessary if you are running the full version!
  • Application Support Directory: Enter the path where you would like to save your Plex Media Server user-generated files (library, logs, etc.). Recommended that you put this somewhere on your protected array. Do not use your flash drive for the library. For those who are already running Plex and already have a library, choose the parent folder where your Library is currently located. This would be something along the lines of /Path/to/Library/Application Support/.
  • Temporary Directory: Enter the path where you would like to save any temporary files (ie: transcodes for iOS devices, etc.) Do not select /tmp or /boot or anywhere on your USB flash drive.
  • Click on Save Configuration to save your settings. If any errors were detected in the path locations that you specified, the plugin will tell you.
  • If all went well, click on Start to start Plex Media Server.

 

By default, Plex is installed in /usr/local/plex and all user generated data (library, plug-ins, temporary files) are stored in /mnt/disk1/plex/.

 

Thanks

 

I'd like to thank Elan from the Plex team for answering a bunch of questions I had during the development of this plugin as well as bubbaQ for his lighttpd plugin that I used as a template in developing the Plex plugin.

 

Download

 

 

Changes

 

v0.1 - August 3, 2011

  • First public release

 

v0.2 - August 4, 2011

  • FIX: Plugin wouldn't show up under "Utils" in unRAID (direct URL still worked).

 

v0.3 - August 7, 2011

  • NEW: Add the ability to run Plex as a different user other than "root". Please re-configure your plugin once you've installed this version. Default will still be "root".
  • NEW: New initialization script /boot/custom/plex/init.sh that is auto-generated and starts Plex in the background under the user configured to run the process. Please use this initialization script from now on to start plex in your /boot/config/go. Do not use plex.sh
  • NEW: Preliminary logging to /var/log/plexunraid.log

Link to comment
  • Replies 197
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

To auto-start Plex on boot-up (v0.3+)

 

Insert the following lines in your /boot/config/go file, it will auto start Plex in the background, using the configured "run as" user after 1 minute :

 

# Auto-start PMS on boot
echo "/boot/custom/plex/init.sh" | at now +1 minute

 

Note that when you shut down your server, your array will be unable to unmount due to files being in use by Plex. You will have to stop Plex manually when you shutdown.

Link to comment

Enter the path where you would like to save your Plex Media Server user-generated files (library, logs, etc.). Recommended that you put this somewhere on your protected array.

 

Thank you very much Stokkes! Will test this in a few minutes. Currently running plex on my cache drive.

 

Does saving Plex user generated files in the protected array will keep the parity and the drive from sleeping?

Link to comment

Thank you very much Stokkes! Will test this in a few minutes. Currently running plex on my cache drive.

 

Does saving Plex user generated files in the protected array will keep the parity and the drive from sleeping?

 

Yes it will, but your library, etc will be protected. You can definitely store the generated files on your cache drive if you so wish (that's currently what I'm doing but thinking of moving it to the array).

 

Cheers

Link to comment

Great work! Install went fine. After a server restart, Plex does not start automatically. I did a test run of the "/boot/custom/plex/plex.sh &> /dev/null & | at now + 1 minute" command from the terminal and got this error:  -bash: syntax error near unexpected token `|'

 

Also, the icon for "Plex Media Server" is not showing up in the Utils menu. Using the latest Simple features plug in.

 

I had to add "installpkg /boot/custom/plex-0.1-i386-unRAID.tgz" in my go script if using "/usr/local/plex/" as the install directory since that resides in memory.

 

I used the following configuration:

Installed Directory: /usr/local/plex/

Application Support Directory: /mnt/cache/Apps/Plex/Library/

Temp Folder: /mnt/cache/tmp/

Link to comment

Great work! Install went fine. After a server restart, Plex does not start automatically. I did a test run of the "/boot/custom/plex/plex.sh &> /dev/null & | at now + 1 minute" command from the terminal and got this error:  -bash: syntax error near unexpected token `|'

 

Also, the icon for "Plex Media Server" is not showing up in the Utils menu. Using the latest Simple features plug in.

 

I had to add "installpkg /boot/custom/plex-0.1-i386-unRAID.tgz" in my go script if using "/usr/local/plex/" as the install directory since that resides in memory.

 

I used the following configuration:

Installed Directory: /usr/local/plex/

Application Support Directory: /mnt/cache/Apps/Plex/Library/

Temp Folder: /mnt/cache/tmp/

 

A few things

 

1) Try adding this line instead in your /boot/config/go (this SHOULD work.. let me know).

/boot/custom/plex.sh &> /dev/null |& at now + 1 minute

 

2) Add the .tgz to /boot/extra so that it gets installed. The alternative is to use the "Light" version and manually install plex on your cache drive or your array. It's up to you. There should be no reason to do an "installpkg" in your go. There shouldn't be too many repercussions running Plex in memory as nothing really gets written to the install dir (it all goes into the Application Support dir).

 

Let me know!

Link to comment

What's the difference between full and light?

For Light Version

Download Plex from the official website and extract the .bz2 file somewhere on your array. Remember where you have installed it as you will need it for the configuration steps below. Do not install Plex on your USB flash!

Full version includes Plex.

 

Cheers.

Link to comment

Does this plugin rely on unmenu to work? I have installed to flash/custom and also use the simplefeatures gui, but the plex app is not added to the webgui and plex does not start automatically when unraid starts. I don't use unmenu.

 

Regards,

 

Roland

 

No, the directions he gives have nothing to do with unMenu.

Link to comment

Does this plugin rely on unmenu to work? I have installed to flash/custom and also use the simplefeatures gui, but the plex app is not added to the webgui and plex does not start automatically when unraid starts. I don't use unmenu.

 

Regards,

 

Roland

 

No, the directions he gives have nothing to do with unMenu.

 

My understanding is that installpkg plexlight-<version>-i386-unRAID.tgz only needs to be executed once. Is this correct or should it be added to the go script so that it is installed after every reboot?

Link to comment

Does this plugin rely on unmenu to work? I have installed to flash/custom and also use the simplefeatures gui, but the plex app is not added to the webgui and plex does not start automatically when unraid starts. I don't use unmenu.

 

Regards,

 

Roland

 

Nope..

 

Make sure you've met these conditions:

 

  • You have unRAID v5-beta10
  • You have downloaded the full version (v0.2)
  • You have put the downloaded file in your flash/extra directory (not flash/custom)
  • You have rebooted your server once you've put the tgz file in your flash/extra folder

 

If you follow all these steps and have v5b10, there really is no reason why it will not work. You will have to go to your unRAID gui, click on "Utils" and you will see a Plex Media Server icon. Click on it and configure it as necessary.

Link to comment

My understanding is that installpkg plexlight-<version>-i386-unRAID.tgz only needs to be executed once. Is this correct or should it be added to the go script so that it is installed after every reboot?

 

Correct.

 

Whatever the version, put it in your flash/extra folder (or /boot/extra if you're a linux command line guy) and it will re-install properly on every boot. Your configuration files will NOT be overwritten.

Link to comment

Whatever the version, put it in your flash/extra folder (or /boot/extra if you're a linux command line guy) and it will re-install properly on every boot. Your configuration files will NOT be overwritten.

OK, I did that, and if I log on to my server, I can see all the correct files, in the correct locations, so I know the package was "exploded" correctly, but no Plex icon on the Utils page.

 

I can get to the configuration however by going directly to http://the-vault/Utils/Plex.

 

BTW  Forgot to add.  Neato, many thanks for this.

 

And a suggestion.  Can you add a way to re-direct the console stdout/stderr to a file, as the Plex guys need this if there's any kind of trancoding issues.

 

Cheers.

Link to comment

OK, I did that, and if I log on to my server, I can see all the correct files, in the correct locations, so I know the package was "exploded" correctly, but no Plex icon on the Utils page.

 

I can get to the configuration however by going directly to http://the-vault/Utils/Plex.

 

BTW  Forgot to add.  Neato, many thanks for this.

 

And a suggestion.  Can you add a way to re-direct the console stdout/stderr to a file, as the Plex guys need this if there's any kind of trancoding issues.

 

Cheers.

 

Did you download v0.2 and install that one? It includes a special file so you can "see" Plex in the Utils page.

Link to comment

Awesome work!

 

Is anyone running this also running SABnzbd and Sickbeard? I seem to have an issue where PMS process just dies. Not sure if its the install, or something caused by SABnzbd and Sickbeard. I'm gonna try with this package and see what happens.

 

I'm not trying to hijack this thread, just wondering if anyone else has seen this whilst testing PMS?

Link to comment

I am running all three (PMS, Sickbeard, SAB) and even a few more things in the background without any issues. What is probably happening is that the PMS process is writing temp files to your root directory (/tmp) which is only as big as your USB flash. It may be running out of room, causing it to crap out.

 

If you run this plugin and configure your tmp somewhere on your array (or even better, your cache drive in like /mnt/cache/.tmp), it's one way to alleviate this issue (not saying it'll fix it, but won't hurt).

Link to comment

I am running all three (PMS, Sickbeard, SAB) and even a few more things in the background without any issues. What is probably happening is that the PMS process is writing temp files to your root directory (/tmp) which is only as big as your USB flash. It may be running out of room, causing it to crap out.

 

If you run this plugin and configure your tmp somewhere on your array (or even better, your cache drive in like /mnt/cache/.tmp), it's one way to alleviate this issue (not saying it'll fix it, but won't hurt).

I have this line in my start.sh script:

 

export TMPDIR=/mnt/cache/.tmp

 

and the .tmp folder does exist on my cache drive. Weird thing is that I have 50Mb of free ram, out of 2Gb. Anyway, I'll start a new thread as I don't want to hijack yours.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.