diff options
Diffstat (limited to 'media-tv/plex-media-server/files/plex-media-server.init.d')
-rw-r--r-- | media-tv/plex-media-server/files/plex-media-server.init.d | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/media-tv/plex-media-server/files/plex-media-server.init.d b/media-tv/plex-media-server/files/plex-media-server.init.d new file mode 100644 index 000000000000..81204c87335c --- /dev/null +++ b/media-tv/plex-media-server/files/plex-media-server.init.d @@ -0,0 +1,16 @@ +#!/sbin/openrc-run + +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 $? +} |