# plexmediaserver refuses to start



## brxken128 (Jun 27, 2022)

So I created a jail with the following config options:


```
plex {
    path = "usr/jail/plex";
    exec.start = "/bin/sh /etc/rc";
    exec.stop = "/bin/sh /etc/rc.shutdown";
    exec.clean;
    allow.nomount;
    mount.devfs;
    host.hostname = "$name.jail.plex";
    mount.fstab = "/etc/fstab.plex"
    ip4 = inherit;
    ip6 = inherit;
    allow.raw_sockets;
}
```

This is on FreeBSD 13.1. It's a barebones install, with no firewall, DHCP networking, very basic setup. I chose to use inherit as I've spent the whole day messing around with ezjail and VNET, and I couldn't find anything that actually worked - it just made me want to pull my hair out. The fstab entry mounts my media to /content within the jail, and it successfully mounts.

Within the jail, I ran:


```
pkg install plexmediaserver
(added it to /etc/rc.conf)
service plexmediaserver start
service plexmediaserver status
```

And it told me that plexmediaserver wasn't running. Not a single log in the Plex config directory, and nothing was actually created there aside from the "Plex Media Server" folder. No relevant logs are populated anywhere, from what I can see.

I've tried rebooting the jail, rebooting the host, re-setting up the jail - no dice. I'd really appreciate some help, or even just pointers into the right direction. Thank you!


----------



## Bobi B. (Jun 27, 2022)

Try adding `ip4.addr += "lo1|127.0.0.1/32";` to "plex" section in your /etc/jail.conf. Also, there might be log files in /usr/local/plexdata/Plex Media Server/Logs.


----------



## brxken128 (Jun 27, 2022)

Bobi B. said:


> Try adding `ip4.addr += "lo1|127.0.0.1/32";` to "plex" section in your /etc/jail.conf. Also, there might be log files in /usr/local/plexdata/Plex Media Server/Logs.



I tried that, and it hasn't worked I'm afraid. The output of `ls -la "/usr/local/plexdata/Plex Media Server/"` is:


```
root@plex:/ # ls -lla "/usr/local/plexdata/Plex Media Server/"
total 1
drwxr-xr-x  2 plex  plex   2 Jun 27 16:33 .
drwxr-xr-x  4 root  wheel  4 Jun 27 16:33 ..
root@plex:/ #
```


----------



## Bobi B. (Jun 27, 2022)

Have you tried to run Plex manually? You can trace what its startup script does by running `jexec plex`, then `sh -x /usr/local/etc/rc.d/plexmediaserver start`. Perhaps starting Plex in console might shed some light on the issue, maybe some error will surface.


----------



## brxken128 (Jun 27, 2022)

Bobi B. said:


> Have you tried to run Plex manually? You can trace what its startup script does by running `jexec plex`, then `sh -x /usr/local/etc/rc.d/plexmediaserver start`. Perhaps starting Plex in console might shed some light on the issue, maybe some error will surface.



I can't seem to see anything erroneous in there, although I'm not too sure what I'm looking for in this case. The first lines look irrelevant, so I'll post everything past the environment variable exporting:


```
+ export 'PATH=/usr/local/share/plexmediaserver/Resources/Python/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/root/bin'
+ export 'LC_ALL=en_US.UTF-8'
+ export 'LANG=en_US.UTF-8'
+ ulimit -s 3000
+ [ ! -d /var/run/plex ]
+ [ ! -d '/usr/local/plexdata/Plex Media Server' ]
+ [ ! -d /usr/local/plexdata/Plex ]
+ [ ]
+ _return=0
+ [ 0 -ne 0 ]
+ check_required_after start
+ local _f _args
+ return 0
+ return 0
+ startmsg 'Starting plexmediaserver.'
+ check_startmsgs
+ [ -n '' ]
+ return 0
+ echo 'Starting plexmediaserver.'
+ [ -n '' ]
+ _cd=''
+ _doit='/usr/sbin/daemon  -f /usr/local/share/plexmediaserver/Plex_Media_Server'
+ [ -n plex ]
+ _doit=$'su -m plex -c \'sh -c "/usr/sbin/daemon  -f /usr/local/share/plexmediaserver/Plex_Media_Server"\''
+ [ -n '' ]
+ [ -n '' ]
+ _doit=$' limits -C daemon  su -m plex -c \'sh -c "/usr/sbin/daemon  -f /usr/local/share/plexmediaserver/Plex_Media_Server"\''
+ _run_rc_doit $' limits -C daemon  su -m plex -c \'sh -c "/usr/sbin/daemon  -f /usr/local/share/plexmediaserver/Plex_Media_Server"\''
+ debug $'run_rc_command: doit:  limits -C daemon  su -m plex -c \'sh -c "/usr/sbin/daemon  -f /usr/local/share/plexmediaserver/Plex_Media_Server"\''
+ eval $' limits -C daemon  su -m plex -c \'sh -c "/usr/sbin/daemon  -f /usr/local/share/plexmediaserver/Plex_Media_Server"\''
+ limits -C daemon su -m plex -c 'sh -c "/usr/sbin/daemon  -f /usr/local/share/plexmediaserver/Plex_Media_Server"'
+ _return=0
+ [ 0 -ne 0 ]
+ return 0
+ _run_rc_postcmd
+ [ -n '' ]
+ return 0
+ [ -n '' ]
+ return 0
```

There is `+ debug 'pid file (/var/run/plex/plex.pid): not readable.'` as well, but I'm not sure if that's relevant.


----------



## Bobi B. (Jun 27, 2022)

Would you try to run `jexec plex`, `su -m plex`, then `/usr/local/share/plexmediaserver/Plex_Media_Server` (as "plex" user)? You might have to copy & run `export ...` lines first.


----------



## brxken128 (Jun 27, 2022)

Bobi B. said:


> Would you try to run `jexec plex`, `su -m plex`, then `/usr/local/share/plexmediaserver/Plex_Media_Server` (as "plex" user)? You might have to copy & run `export ...` lines first.


I ran this in `sh`, and although I exported everything (most importantly, `LD_LIBRARY_PATH`) it's still spitting out this error:


```
ld-elf.so.1: Shared object "libsoci_core.so" not found, required by "Plex_Media_Server"
```

It's definitely present in /usr/local/share/plexmediaserver/lib so it may just be an issue with how I set it up.


----------



## tschucho (Aug 31, 2022)

Hi, same for me. I´m not running plex in a jail.
In the start script I removed the -f flag for daemon to see more output.
Added in the rc.d start script for plex a "set|grep LD_LIBRARYA_PATH" - output ist correct. PATH is correct.
Still says:
service plexmediaserver_plexpass start
LD_LIBRARY_PATH=/usr/local/share/plexmediaserver-plexpass/lib
Starting plexmediaserver_plexpass.
ld-elf.so.1: Shared object "libsoci_core.so" not found, required by "Plex_Media_Server"

Any news about this?


----------



## SirDice (Aug 31, 2022)

Seems to work just fine:

```
root@plex:~ # pkg version -vRx plex
Updating dicelan repository catalogue...
dicelan repository is up to date.
All repositories are up to date.
plexmediaserver-1.28.1.6092        =   up-to-date with remote
root@plex:~ # service plexmediaserver status
plexmediaserver is running as pid 97115.
root@plex:~ # uname -a
FreeBSD plex.dicelan.home 13.1-RELEASE-p1 FreeBSD 13.1-RELEASE-p1 GENERIC amd64
```


----------



## SirDice (Aug 31, 2022)

Hmm, I'm wondering what the difference is between multimedia/plexmediaserver and multimedia/plexmediaserver-plexpass besides the version numbers. 

After a bit of digging, it seems the -plexpass version is a _beta_ release. So I would suggest just using 'regular' version instead. It's not that far fetched to assume a _beta_ version has issues. Also, keep in mind that the Plex software is a pre-compiled binary built by Plex themselves.


----------



## bjs (Aug 31, 2022)

SirDice is correct about the -plexpass version is a beta release as well as being a pre-compiled binary. But you don't have to run the -plexpass version to enjoy the other benefits of having purchased a plexpass. As the current maintainer for the plexmediaserver and -plexpass ports and the purchaser of a lifetime plexpass, personally, I have never run a -plexpass version before it was released to everyone on any of my servers.


----------

