Resource icon

Scripted Plex installation

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
I don't see any evidence that the plexmediaserver service is running, just that the jail is running.
 

Jord9857

Explorer
Joined
Apr 28, 2020
Messages
74
I'm not how i can prove Plex is running then... I just tried changing the IP but made no difference.

1588272922197.png
 

Jord9857

Explorer
Joined
Apr 28, 2020
Messages
74
Hi,

I think the permissions are wrong or something... Plex is unable to see the items in the Media\Movies & \TV Shows and \Music Folders.

There is nothing in this folder, but there is in the TV Shows folder & it's like it can detect it but can't see/show it...

1588412076447.png


1588412137582.png
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
Do you want to take that into its own thread, rather than this one? This is properly to discuss danb35's resource.

You are right that this is likely a permissions issue. You can try and set up a Media share with "pristine" permissions, then compare to yours and see where they differ. I have a video that discusses basic permissions, including for Plex, at https://youtu.be/9Xsgsap0wgQ
 
Joined
Jan 4, 2014
Messages
1,644
What I like about this script is that it keeps the Plex metadata outside the jail. This makes it straightforwad to replicate both media and metadata to a backup server. My question is 'Does it make sense to replicate the Plex jail as well, or is it more sensible to run the script again on the backup server, but set the jail in a down state to maintain that Plex server in a cold standby mode to be activated only in the event of a failure of the primary Plex server?'
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
'Does it make sense to replicate the Plex jail as well, or is it more sensible to run the script again on the backup server, but set the jail in a down state to maintain that Plex server in a cold standby mode to be activated only in the event of a failure of the primary Plex server?'

It depends a little bit on the pool configuration. If the pool is named identically on both sides and the paths are identical and the FreeNAS versions are identical, you can replicate iocage across and it will work. Just did that this morning actually.
If pool names or path names are different, you’d want to create the jail from scratch and then set it to down state.

The advantage of replicating is that Plex version upgrades will be replicated across, the disadvantage is that both sides really need to look identical as far as Plex is concerned.

if you create a new jail you can also give it a different IP address and spin it up for test purposes as desired, without impacting your production jail.
 

Toydoll

Dabbler
Joined
Sep 17, 2015
Messages
33
Thank you both for the script and the youtube video.

After trying to unsuccessfully move my old Plex metadata to a new Plex I decided to take it slow and follow the script along with the video. Everything went very smooth. But...

Edit: I don't really dare to say to much yet but I do seem to have found a solution. I did some searching around and started to understand that it was weird that the logs in /plex_data/'Plex Media Server'/logs/ didn't get updated. So I did a quick look on who had the full rights to that directory. It turned out that it was the user root and group wheel. I had no idea if that was correct or not so I compared that to a working jail with plex and saw that in that jail it was "plex" and "plex" that was the owner (if owner is the correct word).
Some chown magic later and now it works!

Don't ask me where in the progress root became the owner. I would guess that I once copied all metadata as root, did that forever change the owner?

If anyone might be in my situation you can use "ls -l /path/to/directory" to see who the owner of that directory is.
And to change you can use "chown -R plex:plex /path/to/directory". If you get an error that the user and/or group is illegal then you need to create that user and group. Simply open the GUI -> accounts -> user -> add. I set "plex" as the name and "972" as the UID since someone somewhere said 972 is the standard uid for plex.


It doesn't work.

If I had to guess the problem is this:

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.


As you can see "service plexmediaserver start" did nothing. I agree that this thread shouldn't be to much about troubleshooting but I figured I could at least throw away a quick question to see if there's a common solution for this.

The jail seems to be connected to internet (I can ping websites from it. I can also ping the jail from my pc).

I'm guessing that there is some log that can help me find the answer but which one and where do I find it? I have looked at plex_data/'Plex Media Server'/logs/'plex media server.log' but it has no new entries.
I have also looked in a few logs over at /var/logs but I couldn't find anything relevant. But as you probably have guessed I'm behaving a bit like a blind hen at the moment.
 
Last edited:

Ruff.Hi

Patron
Joined
Apr 21, 2015
Messages
271
Would it be helpful to see someone walk through using the script? I created a video for that, which is at https://www.youtube.com/watch?v=GvM32lWc_r4

Very helpful - thank you.

I already have my plex meta data in a dataset and outside of my current plex jail. Do I need to create a new dataset and rsync my data over ... or can I just a) create plex_data dataset, run the script, repoint the mount point to my old meta data dataset and delete plex_data?

I will try this on my non-prod environment.

Edit: Started my own thread to layout my situation.
 
Last edited:

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
No need to rsync, just mount the dataset in as-is. It’ll need to have permissions for Plex:Plex but that’s likely already the case.
 

mm3000

Cadet
Joined
Oct 1, 2020
Messages
3
Hi, I am getting a failed install with the script and was hoping for some help. I am running the latest 11.3-STABLE.
I have run the script before with no issues. However now the script is failing on verifying the pkg signature. Please see below.
Is there anything I can do to fix this?
Thanks


Code:
root@freenas[/freenas-iocage-plex]# ./plex-jail.sh
Netmask not set, defaulting to /24 (255.255.255.0)
Plex media path not set, please mount media directory manually when done
Not configuring hardware transcode
Using stable-release plexmediaserver code
Creating jail pms. This may take a minute, please be patient.
pms successfully created!
No default gateway found for ipv6.
* Starting pms
  + Started OK
  + Using devfs_ruleset: 6
  + Configuring VNET OK
  + Using IP options: vnet
  + Starting services OK
  + Executing poststart OK
Successfully added mount to pms's fstab
Successfully added mount to pms's fstab
Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/FreeBSD:11:amd64/latest, please wait...
pkg: error:04091068:rsa routines:INT_RSA_VERIFY:bad signature
Verifying signature with trusted certificate pkg.freebsd.org.2013102301... failed
Signature is not valid
Command: pkg install plexmediaserver failed!
Failed to install plexmediaserver package
* Stopping pms
  + Executing prestop OK
  + Stopping services OK
  + Tearing down VNET OK
  + Removing devfs_ruleset: 6 OK
  + Removing jail process OK
  + Executing poststop OK
Destroying pms
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
Which version of FreeNAS 11.3? I think 11.3-U3 was the first that worked around FreeBSD 11.3 going EOL, but maybe I'm thinking U4.1. You can always try 11.4 for the jail, with FreeNAS 11.3-U5, and see whether pkg is happy then.
 

mm3000

Cadet
Joined
Oct 1, 2020
Messages
3
Which version of FreeNAS 11.3? I think 11.3-U3 was the first that worked around FreeBSD 11.3 going EOL, but maybe I'm thinking U4.1. You can always try 11.4 for the jail, with FreeNAS 11.3-U5, and see whether pkg is happy then.
I am running 11.3-U5. Doesn't the script usually create the jail.
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
Been a while since I’ve looked at the script. It creates the jail but doesn’t mandate the version iocage uses. So do some fetch and upgrade for 11.4 jails and see. You can also create yourself a scratch jail to see which conditions must be present for pkg to succeed. The script doesn’t do anything very strenuous.
 

mm3000

Cadet
Joined
Oct 1, 2020
Messages
3
Ok, so I created a jail from scratch using a 11.4-RELEASE-p4 . I have tried pkg update, pkg install and pkg install multimedia/plexmediaserver and they all fail with the pkg:no signature found. Not sure why it is giving me this errro for plex now. As I used the script about 4 months ago and it worked perfectly. Any ideas would be get.
Thanks
 

Yorick

Wizard
Joined
Nov 4, 2018
Messages
1,912
This will be upstream in the repository. Since 11.4 is a production release, you may want to contact the maintainers and see whether they're motivated to fix it.
 

lupinlicious

Dabbler
Joined
Jan 13, 2020
Messages
25
Hello,

I'm using danb35 script and from my Plex web I can see an available version of 1.20.5.3600 but from yesterday it didn't updated itself.
I'm currently stuck on 1.20.4.3517

According to the crontab it's set to run: 18 3 * * 0 pkg upgrade -y && service plexmediaserver restart.

On github, it looks that the script has been updated 2 days ago: https://github.com/danb35/freenas-iocage-plex - I don't know if this is related to my issue?

How can I manually update plex from danb35 script?
Do I need to start over and run the script again to solve my issues with Plex? I Guess it need to remove pms or rename to pms-old?

I'm running FreeNAS-11.3-U5

Thanks
 
Joined
Jan 4, 2014
Messages
1,644
The FreeBSD pkg version lags behind by a few days after updates becoming available.

Code:
# pkg search plexmediaserver
plexmediaserver-1.20.4.3517    Plex Media Server component
plexmediaserver-plexpass-1.20.4.3517 Plex Media Server component


Even further back if you're on TrueNAS.

Code:
# pkg search plexmediaserver
plexmediaserver-1.20.3.3483    Plex Media Server component
plexmediaserver-plexpass-1.20.3.3483 Plex Media Server component
 
Last edited:
Joined
Jan 27, 2020
Messages
577
Anybody else got these Plex VOD and movies features on the plex mainpage after the last update. My libraries got hidden under "more", pretty annoying. I somehow can't get plex to save my settings for the left navigation bar, it defaults everytime I open it.
 

Ruff.Hi

Patron
Joined
Apr 21, 2015
Messages
271
Has anyone tried running this script against TrueNAS 12.0?
 
Top