From 838abbee323091c68ee52bafce9aa0249f6f883e Mon Sep 17 00:00:00 2001 From: Ronald Farrer Date: Tue, 6 Feb 2018 15:28:22 -0800 Subject: [PATCH] Added files dir from previous versions. --- .../files/conf.d/plex-media-server | 7 ++++++ .../files/init.d/plex-media-server | 20 ++++++++++++++++ .../files/systemd/plex-media-server.service | 11 +++++++++ .../files/virtualenv_start_pms.patch | 23 +++++++++++++++++++ 4 files changed, 61 insertions(+) create mode 100644 media-tv/plex-media-server/files/conf.d/plex-media-server create mode 100755 media-tv/plex-media-server/files/init.d/plex-media-server create mode 100644 media-tv/plex-media-server/files/systemd/plex-media-server.service create mode 100644 media-tv/plex-media-server/files/virtualenv_start_pms.patch diff --git a/media-tv/plex-media-server/files/conf.d/plex-media-server b/media-tv/plex-media-server/files/conf.d/plex-media-server new file mode 100644 index 0000000..7fe754f --- /dev/null +++ b/media-tv/plex-media-server/files/conf.d/plex-media-server @@ -0,0 +1,7 @@ +# Config file for /etc/init.d/plex-media-server + +PLEX_PIDFILE="/var/run/plex-media-server.pid" +PLEX_OUTLOG="/var/log/pms/out.log" +PLEX_ERRLOG="/var/log/pms/err.log" +PLEX_USER="plex" +PLEX_SCRIPT="/usr/sbin/start_pms" diff --git a/media-tv/plex-media-server/files/init.d/plex-media-server b/media-tv/plex-media-server/files/init.d/plex-media-server new file mode 100755 index 0000000..102ac80 --- /dev/null +++ b/media-tv/plex-media-server/files/init.d/plex-media-server @@ -0,0 +1,20 @@ +#!/sbin/openrc-run + +depend() { + need avahi-daemon +} + +start() { + ebegin "Starting Plex Media Server" + start-stop-daemon -S -m -p ${PLEX_PIDFILE} -1 ${PLEX_OUTLOG} -2 ${PLEX_ERRLOG} --quiet -u ${PLEX_USER} -N -5 -b --exec ${PLEX_SCRIPT} + eend $? +} + +stop() { + ebegin "Stopping Plex Media Server" + kill -- -`cat ${PLEX_PIDFILE}` + + # Remove stale pid file since this is a dirty solution + rm ${PLEX_PIDFILE} + eend $? +} diff --git a/media-tv/plex-media-server/files/systemd/plex-media-server.service b/media-tv/plex-media-server/files/systemd/plex-media-server.service new file mode 100644 index 0000000..12412a8 --- /dev/null +++ b/media-tv/plex-media-server/files/systemd/plex-media-server.service @@ -0,0 +1,11 @@ +[Unit] +Description=Plex Media Server +After=network.target + +[Service] +Type=simple +User=plex +ExecStart=/usr/sbin/start_pms + +[Install] +WantedBy=multi-user.target diff --git a/media-tv/plex-media-server/files/virtualenv_start_pms.patch b/media-tv/plex-media-server/files/virtualenv_start_pms.patch new file mode 100644 index 0000000..bb4d575 --- /dev/null +++ b/media-tv/plex-media-server/files/virtualenv_start_pms.patch @@ -0,0 +1,23 @@ +--- a/usr/sbin/start_pms 2017-03-01 13:35:28.340489280 -0500 ++++ b/usr/sbin/start_pms 2017-03-01 13:36:05.574540305 -0500 +@@ -8,16 +8,20 @@ + export PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR="${HOME}/Library/Application Support" + if [ -f /etc/default/locale ]; then + export LANG="`cat /etc/default/locale|awk -F '=' '/LANG=/{print $2}'|sed 's/"//g'`" + export LC_ALL="$LANG" + fi + + test -f /etc/default/plexmediaserver && . /etc/default/plexmediaserver + ++# Activate python virtualenv ++. "${PLEX_MEDIA_SERVER_HOME}"/Resources/Python/bin/activate ++ ++ + if [ ! -d "$PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR" ] + then + mkdir -p "$PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR" + if [ ! $? -eq 0 ] + then + echo "WARNING COULDN'T CREATE $PLEX_MEDIA_SERVER_APPLICATION_SUPPORT_DIR, MAKE SURE I HAVE PERMISSON TO DO THAT!" + exit 1 + fi