New PLEX iocage Jail

Ruff.Hi

Patron
Joined
Apr 21, 2015
Messages
271
I have an iocage PLEX jail that is working for me. The meta data is stored out side of the jail and I am able to run my movies, tv shows and record TV.

However, I am using the plexmediaserver-plexpass. I purchased the plexpass a while back and swapped to this version thinking it was the right way to go. It wasn't / isn't. This is beta code. I have been googling about how to swap back and read this thread ...

I also have been reading about the Danb35 script (sounds promising) as well as Yorick's youtube video on using this script (very useful)

I watched the vid and followed along on my own server ... everything was nice and happy until ...

Code:
root@pms:~ # service plexmediaserver status
plexmediaserver is not running.
root@pms:~ # service plexmediaserver start
Starting plexmediaserver.
root@pms:~ # service plexmediaserver status
plexmediaserver is not running.


Hmm. At this point, I am thinking of blowing away the script created pms jail, start my own thread and describe my own setup.
 

Ruff.Hi

Patron
Joined
Apr 21, 2015
Messages
271
Here is what I have at the moment.

Datasets
I have three. One set up for media, one for metadata and one for recorded tv.

jGbogsj.jpg

These are all external to my plex jail.

Plex Jail
I set up the original jail using this post by Cosmo_Kramer with this modification ...

  • Step 5 becomes …
  • pkg install multimedia/plexmediaserver-plexpass
  • … and plexmediaserver becomes …
  • plexmediaserver_plexpass

4Ab4CCX.jpg

Mount Points

015ZmFn.jpg
 

Ruff.Hi

Patron
Joined
Apr 21, 2015
Messages
271
Jumping over to my dev FreeNAS. Everything is pretty much the same.

  1. get the script from github
  2. set up plex-config file
    • used ee (same as in the video
    • why aren't my numberpad buttons working?
    • will add location of my plex media dataset
    • JAIL_IP="192.168.1.236"
    • DEFAULT_GW_IP="192.168.1.1"
    • POOL_PATH="/mnt/DuffleBag"
    • PLEX_CONFIG_PATH="/mnt/DuffleBag/PlexMetaData"
  3. run the script
    • root@FreeNAS2[~]# ./plex-jail.sh
    • zsh: no such file or directory: ./plex-jail.sh
    • nope - no such script exists
    • hmmm ... let me see what github put it ... ahh ...
    • root@FreeNAS2[~/freenas-iocage-plex]# ./plex-jail.sh
    • cannot open /root/freenas-iocage-plex/plex-config: No such file or directory
    • sigh - set it up in the root director ... a quick mv and I will try again
    • script running

Code:

Installation Complete!
Mount your media folder into the jail, then start the jail.
Log in and configure your server by browsing to:
http://192.168.1.236:32400/web
 

Ruff.Hi

Patron
Joined
Apr 21, 2015
Messages
271
Lets have a look-see before we proceed.

pms jail created using 11.3-RELEASE-p7.

Firstly ... pms ... I thought it stood for something else ... but I guess it works for plex media service too.

Secondly ... 11.3-REL-p7? Is that really the latest? I will have a look at the script to see why it picked that.

And the mount point ...

42uMlF4.jpg


That isn't what I asked for? BigPl is another pool on the non-prod server. Hmmm
 

Ruff.Hi

Patron
Joined
Apr 21, 2015
Messages
271
Here is the code that actually creates the jail ... line 164 plus a few.

Code:
# Create jail
echo "Creating jail "${JAIL_NAME}". This may take a minute, please be patient."
if ! iocage create --name "${JAIL_NAME}" -r "${RELEASE}" ip4_addr="${INTERFACE}|${JAIL_IP}/${NETMASK}" defaultrouter="${DEFAULT_GW_IP}" boot="on" host_hostname="${JAIL_NAME}" vnet="${VNET}" ${USE_BASEJAIL} ${DEVFS_RULESET}
then
	echo "Failed to create jail"
	exit 1
fi


This also answers the question of what release ... it is a variable ... and here is the code that assigns a value to that variable ...

Code:
RELEASE=$(freebsd-version | sed "s/STABLE/RELEASE/g" | sed "s/-p[0-9]*//")


Info about the iocage create command can be found here ... or by typing 'man iocage' in putty ...

Code:
     iocage create [-b | --basejail] [-c | --count TEXT] [-e | --empty]
            [-f | --force] [-n | --name TEXT] [-p | --pkglist TEXT]
            [-r | --release TEXT] [-r | --release latest | LATEST]
            [-s | --short] [-t | --template TEXT] [-B | --clone_basejail]
            [-T | --thickjail] [-u | --uuid | TEXT] [PROPERTIES]


It isn't obvious to me where to create the jail (ie which pool).

What does list pools show?
Code:

root@FreeNAS2[/mnt/DuffleBag/FreeNAS]# zpool list
NAME           SIZE  ALLOC   FREE  CKPOINT  EXPANDSZ   FRAG    CAP  DEDUP  HEALTH  ALTROOT
BigPl         10.9T  6.58T  4.30T        -         -     1%    60%  1.00x  ONLINE  /mnt
DuffleBag     3.62T  2.47G  3.62T        -         -     0%     0%  1.00x  ONLINE  /mnt
freenas-boot   111G  6.28G   105G        -         -      -     5%  1.00x  ONLINE  -
root@FreeNAS2[/mnt/DuffleBag/FreeNAS]#


So ... BigPl is the first pool. Can I change the order?

Edit: I think I have my answer by reading this and it talked about changing the system dataset. They what? System dataset is on BigPl. Can't test it now ... lunch time :)
 
Last edited:

Ruff.Hi

Patron
Joined
Apr 21, 2015
Messages
271
Back from lunch ... yum.

Decided to see if I could start the server ...

Code:
root@pms:~ # service plexmediaserver restart
plexmediaserver not running? (check /var/run/plex/plex.pid).
Starting plexmediaserver.
root@pms:~ # service plexmediaserver status
plexmediaserver is not running.
root@pms:~ #


Answer ... no.

Googling lead me to this thread (where SweetAndLow got a little shirty - not without cause) ... but he did drop this in there ...

"service plexmediaserver onestart"

Code:
Sep 27, 2020 16:06:02.527 [0x805640f00] INFO - Plex Tuner Service v1.0.0.0 - FreeBSD PC amd64 - build:
Sep 27, 2020 16:06:02.529 [0x805640f00] INFO - FreeBSD version: 11.3-RELEASE-p11 (FreeBSD 11.3-RELEASE-p11 #0 r3
Sep 27, 2020 16:06:02.529 [0x805640f00] INFO - Processor Intel(R) Xeon(R) CPU E3-1231 v3 @ 3.40GHz
Sep 27, 2020 16:06:02.529 [0x805640f00] INFO - /usr/local/share/plexmediaserver/Plex Tuner Service /usr/local/sh
Sep 27, 2020 16:06:02.527 [0x805616000] INFO -  broker_t::start...
Sep 27, 2020 16:06:02.529 [0x805616000] INFO -  device_manager_t::init.
Sep 27, 2020 16:06:02.530 [0x805616000] INFO -  device_manager_t::init. Initialize provider manager
Sep 27, 2020 16:06:02.530 [0x805616000] INFO -  device_manager_t::init. Initialize all device auxes
Sep 27, 2020 16:06:02.530 [0x805616000] INFO -  dvb_device_factory_t::get_aux_list
Sep 27, 2020 16:06:02.531 [0x805616000] INFO -  web_server_t::start. Starting web server on port 32600
Sep 27, 2020 16:06:11.029 [0x805643c00] INFO -  web_service_t::process_device_discovery
Sep 27, 2020 16:06:11.029 [0x805643c00] INFO -  device_reactor_t::get_device_list ()
Sep 27, 2020 16:06:11.029 [0x805643c00] INFO -  dvb_device_factory_t::get_device_list ()
Sep 27, 2020 16:06:13.063 [0x805643c00] INFO -  SAT2IP - discover_satip_servers(): no servers found

So ... "service plexmediaserver onestart" this and then status gave me this ...

Code:

root@pms:~ # service plexmediaservice onestart
plexmediaservice does not exist in /etc/rc.d or the local startup
directories (/usr/local/etc/rc.d), or is not executable
root@pms:~ # service plexmediaserver onestart
plexmediaserver already running?  (pid=11049).
root@pms:~ # service plexmediaserver status
plexmediaserver is running as pid 11049.


... which I take to mean it is running. But I still can't see plex at the magic ip address :(.

Stopped all of the other jails, restarted pms (and only pms), started plexmediaserver (I keep on typing plexmediaservice here) and ...

bingo ... plex started.

But now it is time to walk the dog. Will see if I can see my material when I get back.
 
Last edited:

Ruff.Hi

Patron
Joined
Apr 21, 2015
Messages
271
dog walked and fed. Will have some time to myself for about 15 minutes.

Plex (under pms) started finally. What is the different between onestart and start?

Anyway ... swapped my older plex to a different IP address and put pms on the existing IP. Opened via the browser ... but couldn't see my media. In fact, it wanted me to create a library. I tried that but it couldn't see any of my mounted media.

That says permissions to me. I have reverted back to my old iocage and will peek at the permissions.
 

Ruff.Hi

Patron
Joined
Apr 21, 2015
Messages
271
I followed the permissions part of this post and now I can see my mounted data. I still had to add a library to test it.

Shouldn't it come with all of the library information already available? Maybe I need to check the permissions on my metadata mount.

Here is the permissions for my metadata ... mounted under config/ ...

pCibOWG.jpg


plex user, plex group. Shouldn't that work? My media is "1000 Media" and I had to create a Media group in the jail.

I have the following groups ...

Code:
Group Name: plex              #972
   Members: plex

Group Name: Media             #1000
   Members: plex


Here is the info for the plex user ...
Code:
Login Name: plex              #972          Group: plex              #972
 Full Name: Plex Media Server
      Home: /nonexistent                    Class:
     Shell: /usr/sbin/nologin              Office: [None]
Work Phone: [None]                     Home Phone: [None]
Acc Expire: [None]                     Pwd Expire: [None]
    Groups: plex,Media


Well - now I am stuck.
 
Last edited:

Ruff.Hi

Patron
Joined
Apr 21, 2015
Messages
271
What is the different between onestart and start?

Google supplied this ...

root@plex_1:/ # service plexmediaserver start
Cannot 'start' plexmediaserver. Set plexmediaserver_enable to YES in /etc/rc.conf or use 'onestart' instead of 'start'.

... which implies that rc.conf didn't include that variable. Just looked - it does (now?).
 

Ruff.Hi

Patron
Joined
Apr 21, 2015
Messages
271
I can get pms to work. I added the movie library and it rescanned everything. I have a couple of movies that have the theatrical release and the directors cut and I used the split function to force two movie jackets. The rescan has added them back together.

Worse, it is the same meta data location ... so this has impacted my production plex.

I am going to blow pms away and set it up with a different MetaData location ... then copy the info over.
 

Ruff.Hi

Patron
Joined
Apr 21, 2015
Messages
271
Success! I created another dataset for the meta data (PMSMetaData) and then rsync'd my existing stuff over.

Worked like a dream. I am going to stop both jails, swap my old prod version to a different IP address and then use that IP address for the new pms service.

This script thing worked well ... but the video really helped me understand what was happening. Does this creation script set up an auto update function? I will have to dig into that.


WRONG ... still wouldn't copy over my movie info :(
 

Ruff.Hi

Patron
Joined
Apr 21, 2015
Messages
271
Oh well ... guess I will be flushing my meta data. Have to go through my movies and create collections, sort order, etc, etc. Shouldn't take too long.
 

pschatz100

Guru
Joined
Mar 30, 2014
Messages
1,184
Your posts are very confusing, and I cannot understand what your problem is.

You had some problem with Plexpass, so you decided to create a new iocage jail and install regular Plex instead? And you did this manually - you are not using the Plex plugins? Just for my curiosity, what was your problem with Plexpass? Is the new Plex install working OK?

What is your current issue? Not being able to import the old metadata to the new installation?
 

Ruff.Hi

Patron
Joined
Apr 21, 2015
Messages
271
pschatz ... just saw your reply to my old post. Sorry about the very slow delay in replying.

I have found a few things out since 2020 ... first off, don't use the jail name 'plex'. There is some sort of bug that happens if you do. I don't know why, how, etc ... easy fix, call it something else.

Secondly, I thought the plexpass code was required if I was using plexpass. Turns out the plexpass code is actually beta and the normal plex code doesn't give a hoot if you have plex or plexpass. Answer: just use the plex standard code if you don't want to use beta stuff.

No, I am not using a plugin ... I want a little bit more control than that. And I can live with any downside.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,702

firsway

Dabbler
Joined
Oct 20, 2018
Messages
32
So far as I'm aware, this scripting still works;

# Create the jail
iocage create -n "Plex_01" -r [Jail Release Version] ip4_addr="vnet0|[IP]/24" defaultrouter="[GW IP]" vnet="on"
allow_raw_sockets="1" boot="on"
iocage start Plex_01

# Update to the latest repo
iocage exec Plex_01 "mkdir -p /usr/local/etc/pkg/repos"
iocage exec Plex_01 "echo -e 'FreeBSD: { url: \"pkg+http://pkg.FreeBSD.org/\${ABI}/latest\" }' > /usr/local/etc/pkg/repos/FreeBSD.conf"

# Install Plex and dependencies
iocage exec Plex_01 pkg install -y plexmediaserver-plexpass

# Enable service
iocage exec Plex_01 sysrc "plexmediaserver_plexpass_enable=YES"
iocage exec Plex_01 service plexmediaserver_plexpass start

Also have a look at this site

https://www.reddit.com/r/freenas/comments/eg7rmg/plex_update_using_pms_updatersh/

This provides a script that can automatically keep your Plex application up to date
 
Top