svn commit: r379208 - in head/multimedia/plexmediaserver: . files
Mark Felder
feld at FreeBSD.org
Wed Feb 18 15:09:48 UTC 2015
Author: feld
Date: Wed Feb 18 15:09:47 2015
New Revision: 379208
URL: https://svnweb.freebsd.org/changeset/ports/379208
QAT: https://qat.redports.org/buildarchive/r379208/
Log:
Teach the rc script to clean up leftover children
Modified:
head/multimedia/plexmediaserver/Makefile
head/multimedia/plexmediaserver/files/plexmediaserver.in
Modified: head/multimedia/plexmediaserver/Makefile
==============================================================================
--- head/multimedia/plexmediaserver/Makefile Wed Feb 18 14:56:19 2015 (r379207)
+++ head/multimedia/plexmediaserver/Makefile Wed Feb 18 15:09:47 2015 (r379208)
@@ -3,7 +3,7 @@
PORTNAME= plexmediaserver
PORTVERSION?= 0.9.11.7.803
-PORTREVISION?= 0
+PORTREVISION?= 1
CATEGORIES= multimedia
MASTER_SITES= http://downloads.plexapp.com/plex-media-server/${PORTVERSION}-${PLEX_BUILD}/ \
http://nightlies.plexapp.com/directdl/plex-media-server/dist-ninja/${PORTVERSION}-${PLEX_BUILD}/
Modified: head/multimedia/plexmediaserver/files/plexmediaserver.in
==============================================================================
--- head/multimedia/plexmediaserver/files/plexmediaserver.in Wed Feb 18 14:56:19 2015 (r379207)
+++ head/multimedia/plexmediaserver/files/plexmediaserver.in Wed Feb 18 15:09:47 2015 (r379208)
@@ -33,8 +33,10 @@ load_rc_config $name
command=/usr/sbin/daemon
procname="%%DATADIR%%/Plex_Media_Server"
command_args="-f ${procname}"
-start_precmd=plex_precmd
pidfile=/var/run/plex/plex.pid
+start_precmd=plex_precmd
+stop_precmd=plex_stop_precmd
+stop_postcmd=plex_stop_postcmd
plex_precmd()
{
@@ -66,4 +68,19 @@ plex_precmd()
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"
More information about the svn-ports-head
mailing list