Skip to content

Instantly share code, notes, and snippets.

@Nerten
Last active January 15, 2018 23:05
Show Gist options
  • Save Nerten/a8bbbb071b231870bd72 to your computer and use it in GitHub Desktop.
Save Nerten/a8bbbb071b231870bd72 to your computer and use it in GitHub Desktop.
Install Plex Media Server to Ubuntu on Odroid-C1
sudo apt-get install -y libc6-armel gcc-multilib
sudo locale-gen en_US.UTF-8
sudo dpkg-reconfigure locales
mkdir /tmp/plex
wget -P /tmp/plex https://downloads.plex.tv/plex-media-server/0.9.11.7.803-87d0708/plexmediaserver-ros6-binaries_0.9.11.7.803-87d0708_armel.deb
dpkg -x /tmp/plex/plexmediaserver-ros6-binaries_0.9.11.7.803-87d0708_armel.deb /tmp/plex
sudo mv /tmp/plex/apps /
sudo mkdir /apps/plexmediaserver/temp
sudo mkdir /apps/plexmediaserver/MediaLibrary
sudo rm -rf /tmp/plex/
sudo bash -c "cat <<EOT > /etc/init/plexmediaserver.conf
# plexpms - service job file
description \"Plex Media Server\"
author \"http://www.plexapp.com/\"
# When to start the service
start on runlevel [2345]
# When to stop the service
stop on runlevel [016]
# Automatically restart process if crashed
respawn
# Sets nice and ionice level for job
nice -5
# What to execute
script
su -c /apps/plexmediaserver/Binaries/start.sh > /var/log/plexms.log 2>&1
end script
EOT"
sudo bash -c "cat <<EOT > /etc/default/plexmediaserver_environment
# default script for Plex Media Server
# the number of plugins that can run at the same time
PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=6
# ulimit -s \\\$PLEX_MEDIA_SERVER_MAX_STACK_SIZE
PLEX_MEDIA_SERVER_MAX_STACK_SIZE=3000
# uncomment to set it to something else
PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR=\"/apps/plexmediaserver/MediaLibrary\"
# let's set the tmp dir to something useful.
TMPDIR=\"/apps/plexmediaserver/temp\"
# We need to catch our libraries
LD_LIBRARY_PATH=\"/apps/plexmediaserver/Binaries:\\\$LD_LIBRARY_PATH\"
EOT"
sudo bash -c "cat <<EOT > /apps/plexmediaserver/Binaries/start.sh
#!/bin/sh
#SCRIPTPATH=\\\$(dirname \\\$(python -c 'import sys,os;print os.path.realpath(sys.argv[1])' \\\$0))
SCRIPT=\\\$(readlink -f \\\$0)
SCRIPTPATH=\\\`dirname \\\${SCRIPT}\\\`
export LD_LIBRARY_PATH=\"\\\${SCRIPTPATH}\"
export PLEX_MEDIA_SERVER_HOME=\"\\\${SCRIPTPATH}\"
export PLEX_MEDIA_SERVER_MAX_PLUGIN_PROCS=6
export LC_ALL=\"en_US.UTF-8\"
export LANG=\"en_US.UTF-8\"
ulimit -s 3000
cd \\\${SCRIPTPATH}
./Plex\ Media\ Server
EOT"
sudo service plexmediaserver start
@Efreak
Copy link

Efreak commented Mar 14, 2015

This gets plex running, but I'm unable to actually watch anything from the android client, and listening to music via the browser is terrible (skips when it actually works, usually it doesn't work). The DLNA server works just fine though.

Is there anything that needs to be installed for transcoding? ffmpeg and mkvtoolnix are both installed, but I can compile ffmpeg from source for nonfree stuff if you think it's required (I have very little idea what I'm doing here...)

Also, it would be nice to add setuid and getuid to the upstart script. I'm still trying to get it working myself...I'm trying to figure out how to get that working myself, without causing it to fail as soon as it starts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment