how does one edit rc.d? I’m not at all familiar with this though I have found it.
You’ll have to do a google search for how to use the VI command. However I’m not convinced editing it is the only answer here.
@bbateman can you please post you’r full rc.d script?
OK here you go:
. /etc/rc.subr
name=plexmediaserver
rcvar=plexmediaserver_enable
load_rc_config $name
: ${plexmediaserver_enable:=NO}
: ${plexmediaserver_support_path="/usr/pbi/plexmediaserver-amd64/plexdata"}
: ${plexmediaserver_user="plex"}
: ${plexmediaserver_group="plex"}
: ${plexmediaserver_maxplugins=6}
command=/usr/sbin/daemon
procname="/usr/pbi/plexmediaserver-amd64/share/plexmediaserver/Plex_Media_Server"
command_args="-f ${procname}"
pidfile=/var/run/plex/plex.pid
start_precmd=plex_precmd
stop_precmd=plex_stop_precmd
stop_postcmd=plex_stop_postcmd
plex_precmd()
{
#Set identification variables for FREENAS; with fall back to freebsd
if [ -f "/etc/version" ]; then
export PLEX_MEDIA_SERVER_INFO_VENDOR="$(cat /etc/version|cut -d-
-f1)"
export PLEX_MEDIA_SERVER_INFO_DEVICE=NAS
export PLEX_MEDIA_SERVER_INFO_MODEL="$(uname -m)"
export PLEX_MEDIA_SERVER_INFO_PLATFORM_VERSION="$(cat /etc/versi
on|cut -d- -f2-)"
else
export PLEX_MEDIA_SERVER_INFO_VENDOR=FreeBSD
export PLEX_MEDIA_SERVER_INFO_DEVICE=PC
export PLEX_MEDIA_SERVER_INFO_MODEL="$(uname -m)"
export PLEX_MEDIA_SERVER_INFO_PLATFORM_VERSION="$(uname -r)"
fi
export TMPDIR="/tmp"
export SUPPORT_PATH="${plexmediaserver_support_path}"
export HOME="${plexmediaserver_support_path}/Plex Media Server"
export PYTHONHOME="/usr/pbi/plexmediaserver-amd64/share/plexmediaserver/
Resources/Python"
export SCRIPTPATH="/usr/pbi/plexmediaserver-amd64/share/plexmediaserver"
#//export LD_LIBRARY_PATH="/usr/pbi/plexmediaserver-amd64/lib/compat:${S
CRIPTPATH}"
export LD_LIBARARY_PATH="${SCRIPTPATH}/lib"
export PLEX_MEDIA_SERVER_HOME="${SCRIPTPATH}"
export PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=${plexmediaserver_maxplugins}
export PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=${plexmediaserver_suppo
rt_path}
export PLEX_MEDIA_SERVER_PIDFILE=${pidfile}
export PLEX_MEDIA_SERVER_LOG_DIR="${plexmediaserver_support_path}/Plex M
edia Server/Logs"
export PATH="${SCRIPTPATH}/Resources/Python/bin:${PATH}"
export LC_ALL="en_US.UTF-8"
export LANG="en_US.UTF-8"
ulimit -s 3000
if [ ! -d ${pidfile%/*} ]; then
install -d -o ${plexmediaserver_user} ${pidfile%/*};
fi
if [ ! -d "${plexmediaserver_support_path}/Plex Media Server" ]; then
install -d -g ${plexmediaserver_group} -o ${plexmediaserver_user
} "${plexmediaserver_support_path}/Plex Media Server";
fi
if [ ${plexmediaserver_tmp} ]; then
export TMPDIR=${plexmediaserver_tmp};
install -d -g ${plexmediaserver_group} -o ${plexmediaserver_user
} "${plexmediaserver_tmp}";
fi
}
plex_stop_precmd()
{
if [ -r ${pidfile} ]; then
export _PLEXPID=$(check_pidfile ${pidfile} ${procname})
fi
}
plex_stop_postcmd()
{
_PLEX_CHILDREN=$(pgrep -g ${_PLEXPID})
echo "Cleaning up leftover child processes."
kill $sig_stop ${_PLEX_CHILDREN}
wait_for_pids ${_PLEX_CHILDREN}
}
run_rc_command "$1"
This looks broken… remove the first line and just keep export LD_LIBARARY_PATH="${SCRIPTPATH}/lib"
FYI the freebsd port is update now so you can looks at the fixed script there.
Thanks Mike,
That line was commented out - so removing it made no difference. I also updated to the latest version 1.15.1.710 to see if it made a difference. It didn’t.
Where do I find the script to look at it? I opened the downloaded file for 1.15.1.710 and don’t see it in there.
B
Edit: After the update to 1.15.1.710 it says it was done. But it still said 1.1.5.1.710 was available download in the UI. Restarted the server and now the local WebUI says 404 Not Found and the Desktop interface won’t play anything. Rebooted again and now its working fine. And it’s not saying that an update is available anymore. All of this was in the interest of being complete.
Also happening - it tries to play my content and gives me an error that Conversion Failed: The transcoder failed with an error. Probably a symptom of the overall problem.
I’m trying the new version (1.15.1.710) by doing:
1.) Stopping the plug-in
2.)
fetch -o PlexMediaServer-1.15.1.710-ece95b3a1-FreeBSD-amd64.tar.bz2 https://downloads.plex.tv/plex-media-server-new/1.15.1.710-ece95b3a1/freebsd/PlexMediaServer-1.15.1.710-ece95b3a1-FreeBSD-amd64.tar.bz2
3.)
./PMS_Updater.sh -l PlexMediaServer-1.15.1.710-ece95b3a1-FreeBSD-amd64.tar.bz2 -vv -a
I got something saying it can’t start the plex server. So I tried again without stopping the plex plug-in on the FreeNAS UI and adding “-f” to (3.) above
Verifying PlexMediaServer-1.15.1.710-ece95b3a1-FreeBSD-amd64.tar.bz2 …Done
Removing previous PMS Backup …Done.
Stopping Plex Media Server …Stopping plexmediaserver.
Waiting for PIDS: 53927.
Cleaning up leftover child processes.
And is stuck there… what should I do? Should I close the “shell” window on FreeNAS? Oh dear…
I normally just do a control-C and then run it again.
I manged to go through the second time. Sadly it still says “Server settings are unavailable.” 
The line was commented yes but there was a space and a new line with that would cause issues… It possible it was a bad paste.
Anyway you can see updates to the port here https://www.freshports.org/multimedia/plexmediaserver-plexpass/
This is the freebsd port not the freenas plug-in though.
Some folks as you can see by other posts use them updater script you can find on on github.
However it seems like you are able to start it now but something else is wrong.
Can you please post the output of:
sockstat - l4
And if possible DM me you’re Preferences.xml!?
That file should be inside the “Plex Data Dir” look here https://support.plex.tv/articles/202915258-where-is-the-plex-media-server-data-directory-located/ for help locating it.
could you point me to the update script please? I’m not familiar with github.
OK - I’ve got it working. Reinstalled the 1.15.1.710 and then installed nano because VI is evil. Used nano to go through the rc.d/plexmediaserver and made sure that everything was good from top to bottom (end of lines, etc). It’s now working 100%.
I’m relatively shallow when it comes to bsd - but it was challenging for me to figure it out. In the end, it was mainly the
export LD_LIBRARY_PATH=“${SCRIPTPATH}/lib”
that caused the most trouble.
B
Haha vi is no evil at all but definitely not the best choice if your not used to it.
For future reference freebsd base also includes ee which might be easier.
Glad you got it working.
Can a noob (like myself) get some help also? Still settings not available. Even some suggestion on how I can roll back would be awesome.
On the brink of downloading all my files and moving to a windows version - prolly better for my skill /knowledge level…
How did you upgrade!? Via the Updater script!? If so the only thing needed making sure the rc.d script in ok.
Might be best to upgrade using the port now that it’s up to date.
PMS_Updater.sh didn’t work -> it was looking for a file that doesn’t exist.
So - this is where I think I buggered things up - did a fetch from the plex website then ran PMS_Updater.sh followed by the downloaded file…
./PMS_Updater.sh -l PlexMediaServer-1.15.1.710-ece95b3a1-FreeBSD-amd64.tar.bz2 -vv -a
This kept having problem when it gets to “cleaning up leftover child processes” if I didn’t stop plug-in first, however. Doing so after stopping seems to do the job or at least completed it. Sadly the “server settings are unavailable” problem remains.
I suggest you stick to the port then since the script seems to have messed things for you…
In fact whats the output of pkg info | grep plexmediaserver inside the jail? is it still installed?
I’m running into the same issue with server settings not available after an upgrade.
I blew the jail out and installed normally and did a pkg update and upgrade which lands me on version 707. Same issue persists “Server settings unavailable”.
As others have said, the older version does not exhibit this behavior and going back to the old version fixes it.
Manually installing 710 also exhibits the same behavior. I’m about to try to follow the rc.d edit above but will more than likely roll back to the old version. Let me know what info I can provide to help.
Thanks
If you’re installing via pkgng and got 1.15.1.707_1 (port version) you should have the correct rc.d file…
Of course if scripts were used before you might have a messy install… so It might be worth to make sure you remove the install dir completely (not DATA dir)
No scripts were used on my install. Here are the exact commands I am using to create the jail as new.
echo ‘{“pkgs”:[“plexmediaserver-plexpass”,“ca_root_nss”]}’ > /tmp/pkg.json
iocage create -n “plex” -p /tmp/pkg.json -r 11.2-RELEASE ip4_addr=“vnet0|192.168.1.2/24” defaultrouter=“192.168.1.1” vnet=“on” allow_raw_sockets=“1” boot=“on”
rm /tmp/pkg.json
mkdir /mnt/iocage/jails/plex/root/config
iocage fstab -a plex /mnt/jailssd/apps/plex /config nullfs rw 0 0
iocage fstab -a plex /mnt/phobos/plex_media /media nullfs ro 0 0
iocage exec plex chown -R plex:plex /config
iocage exec plex sysrc “plexmediaserver_plexpass_enable=YES”
iocage exec plex sysrc plexmediaserver_plexpass_support_path=“/config”
iocage exec plex service plexmediaserver_plexpass start
This installs version 1.14.1.5488.
707 will download and apply from a pkg update and upgrade however breaks the settings for the server, media still plays fine.
If I manually install the 710 pkg it exhibits the same behavior. This not using any scripts that others in the thread were using.