summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'media-tv/plex-media-server/files/init.d/plex-media-server')
-rwxr-xr-xmedia-tv/plex-media-server/files/init.d/plex-media-server20
1 files changed, 20 insertions, 0 deletions
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 000000000000..102ac80c287c
--- /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 $?
+}