Plex Media Server won't turn on after FreeNAS reboot

Status
Not open for further replies.

ssgoku129

Dabbler
Joined
Jun 26, 2013
Messages
32
To clarify, if you install a plugin, enable it, and reboot your server. It no longer works?
If this is the case can you also show the output the command I posted in my previous post.
Thanks

Before I enable it, I mount the virtual directory to the newly created jail containing 'Plex Media Server' and my media, I make a symbolic link to PMS in /var/db/plexdata, then start the plugin.

output is:
root@plexmediaserver_1:/ # service plexmediaserver onestart
plexmediaserver already running? (pid=64283).
 

ssgoku129

Dabbler
Joined
Jun 26, 2013
Messages
32
To clarify, if you install a plugin, enable it, and reboot your server. It no longer works?
If this is the case can you also show the output the command I posted in my previous post.
Thanks

Before I enable it, I mount the virtual directory to the newly created jail containing 'Plex Media Server' and my media, I make a symbolic link to PMS in /var/db/plexdata, then start the plugin.

output is:
root@plexmediaserver_1:/ # service plexmediaserver onestart
plexmediaserver already running? (pid=64283).
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Before I enable it, I mount the virtual directory to the newly created jail containing 'Plex Media Server' and my media, I make a symbolic link to PMS in /var/db/plexdata, then start the plugin.

output is:
root@plexmediaserver_1:/ # service plexmediaserver onestart
plexmediaserver already running? (pid=64283).
I was interested in the output of a non-working instance. But, understand if you don't want to break you current setup.
 

ssgoku129

Dabbler
Joined
Jun 26, 2013
Messages
32
I was interested in the output of a non-working instance. But, understand if you don't want to break you current setup.

Oh crap, sorry about that, the output in the non-working jail is:
root@plexmediaserver_1:/ # service plexmediaserver onestart
install: mkdir /var/db/plexdata/Plex Media Server: File exists
Starting plexmediaserver.

So I'm guessing it's my symbolic link?
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Oh crap, sorry about that, the output in the non-working jail is:
root@plexmediaserver_1:/ # service plexmediaserver onestart
install: mkdir /var/db/plexdata/Plex Media Server: File exists
Starting plexmediaserver.

So I'm guessing it's my symbolic link?
Yeah, it's confusing the init script.
See https://github.com/freebsd/freebsd-.../plexmediaserver/files/plexmediaserver.in#L61

The script checks for a directory, doesn't see one (since it's a link not directory). It then tries to install the directory which fails, causing the prestart routine to exit with an error code, which means the start routine is never run.
 

ssgoku129

Dabbler
Joined
Jun 26, 2013
Messages
32
Yeah, it's confusing the init script.
See https://github.com/freebsd/freebsd-.../plexmediaserver/files/plexmediaserver.in#L61

The script checks for a directory, doesn't see one (since it's a link not directory). It then tries to install the directory which fails, causing the prestart routine to exit with an error code, which means the start routine is never run.

Well thanks! I really appreciate the help, I just deleted the symlink and created one in the directory above (so I've got a symlink for /var/db/plexdata now) so the same non-working jail works perfectly fine and just did a reboot to test :), I'll take this as a warning though that this probably won't work for much longer...

If you're wondering why I'm so persistent on keeping this setup, I'd just feel more comfortable having my library off the jail in case it ever fails but if worst comes to worse I'll create a weekly backup and keep it in the jail.
 

Joshua Parker Ruehlig

Hall of Famer
Joined
Dec 5, 2011
Messages
5,949
Well thanks! I really appreciate the help, I just deleted the symlink and created one in the directory above (so I've got a symlink for /var/db/plexdata now) so the same non-working jail works perfectly fine and just did a reboot to test :), I'll take this as a warning though that this probably won't work for much longer...

If you're wondering why I'm so persistent on keeping this setup, I'd just feel more comfortable having my library off the jail in case it ever fails but if worst comes to worse I'll create a weekly backup and keep it in the jail.
I don't blame you, those plex databases can get big and I'm sure take alot of effort to fix.
I'm not sure if this would be better, but instead of a symlink you could just mount the plex directory directly to /var/db/plexdata. That would avoid any issues caused by symlinks.

Goodluck
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
Having you plexdata in the jail is the same as having it symlinked from external data source. The files still live in your pool and act exactly the same. Having a symlink is probably a bad idea since you are exposing a way out of your jail. Why does leaving plexdata in the jail cause problems? If you break the jail you can always save those files at any time.
 

ssgoku129

Dabbler
Joined
Jun 26, 2013
Messages
32
Having you plexdata in the jail is the same as having it symlinked from external data source. The files still live in your pool and act exactly the same. Having a symlink is probably a bad idea since you are exposing a way out of your jail. Why does leaving plexdata in the jail cause problems? If you break the jail you can always save those files at any time.

Okay, I already got sufficient help but if having it symlinked from an external data source is the same as living in my pool, why exactly is having a symlink exposing a way out of the VM given that you just said those 2 methods act the exact same? o_O

If Plex gets a bad update and decides to wipe my PMS folder and it's just a symlink then only the symlink will be deleted, if I leave my metadata in the jail, there's a chance that the data can get deleted, I would rather not risk that chance as before Plex became "officially" supported in FreeNAS, I had a community-created plugin that inevitably wiped my PMS folder thus I've come to doing this as a precaution.

I understand that the data in the jail is accessible regardless of the VM's state but having one bad experience was enough for me to use this method.
 

j_r0dd

Contributor
Joined
Jan 26, 2015
Messages
134
Okay, I already got sufficient help but if having it symlinked from an external data source is the same as living in my pool, why exactly is having a symlink exposing a way out of the VM given that you just said those 2 methods act the exact same? o_O

If Plex gets a bad update and decides to wipe my PMS folder and it's just a symlink then only the symlink will be deleted, if I leave my metadata in the jail, there's a chance that the data can get deleted, I would rather not risk that chance as before Plex became "officially" supported in FreeNAS, I had a community-created plugin that inevitably wiped my PMS folder thus I've come to doing this as a precaution.

I understand that the data in the jail is accessible regardless of the VM's state but having one bad experience was enough for me to use this method.
Why not have your library be a dataset that is mounted as /var/db/plexdata and then you can also take snapshots of it?
 

ssgoku129

Dabbler
Joined
Jun 26, 2013
Messages
32
Why not have your library be a dataset that is mounted as /var/db/plexdata and then you can also take snapshots of it?

Yup Joshua suggested this as well, I just tried and can confirm that it works, maybe making a snapshot is a good idea as well just in case something does happen, thanks!
 

flyinfitz1

Explorer
Joined
Mar 29, 2013
Messages
91
I have a similar issue. Rebooted my Freenas box now the service wont start. When I try and use the script mentioned in this post this is the error I get.

root@plexmediaserver_1:/ # service plexmediaserver onestart
Starting plexmediaserver.
su: pam_start: system error
/usr/local/etc/rc.d/plexmediaserver: WARNING: failed to start plexmediaserver
root@plexmediaserver_1:/ #

Here is my system specs
FreeNAS-9.3-STABLE-201509022158
Lenovo TS140 Thinkserver
Intel i3
12GB of ECC RAM
4x3TB WD red drives in Raid-Z2
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
I have a similar issue. Rebooted my Freenas box now the service wont start. When I try and use the script mentioned in this post this is the error I get.

root@plexmediaserver_1:/ # service plexmediaserver onestart
Starting plexmediaserver.
su: pam_start: system error
/usr/local/etc/rc.d/plexmediaserver: WARNING: failed to start plexmediaserver
root@plexmediaserver_1:/ #

Here is my system specs
FreeNAS-9.3-STABLE-201509022158
Lenovo TS140 Thinkserver
Intel i3
12GB of ECC RAM
4x3TB WD red drives in Raid-Z2
You modified the permission of your jail dataset. Your can't do this and have it working correctly. You should backup your Plex database, delete jail and build a new one.
 

flyinfitz1

Explorer
Joined
Mar 29, 2013
Messages
91
You modified the permission of your jail dataset. Your can't do this and have it working correctly. You should backup your Plex database, delete jail and build a new one.


That makes sense!
 
Status
Not open for further replies.
Top