Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 4 May 2013 18:27:34 +0000 (UTC)
From:      Chris Rees <crees@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r317332 - in head/java/jboss72: . files
Message-ID:  <201305041827.r44IRYm9088515@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: crees
Date: Sat May  4 18:27:34 2013
New Revision: 317332
URL: http://svnweb.freebsd.org/changeset/ports/317332

Log:
  java/jboss72: distfile rerolled and enhance rc script
  
  Distfile was rerolled, maintainer has checked that there are no spurious changes
  
  RC script now can be tuned to hard way kill stuck JBoss or any child
  processes preventing restart; RC script can be configured to make a
  delay after killing (for example for restart).
  
  Add LICENSE info.
  
  PR:		ports/178142
  Submitted by:	Alexander Yerenkow <yerenkow@gmail.com> (maintainer)

Modified:
  head/java/jboss72/Makefile
  head/java/jboss72/distinfo
  head/java/jboss72/files/jboss72.in

Modified: head/java/jboss72/Makefile
==============================================================================
--- head/java/jboss72/Makefile	Sat May  4 18:08:36 2013	(r317331)
+++ head/java/jboss72/Makefile	Sat May  4 18:27:34 2013	(r317332)
@@ -3,7 +3,7 @@
 
 PORTNAME=	jboss72
 PORTVERSION=	7.2.0
-#PORTREVISION=	0
+PORTREVISION=	1
 #PORTEPOCH=	0
 CATEGORIES=	java www
 MASTER_SITES=	https://javaz.org/distfiles/
@@ -13,6 +13,8 @@ DISTFILES=	m2-${DISTNAME}.tar.xz ${DISTN
 MAINTAINER=	yerenkow@gmail.com
 COMMENT=	JBoss 7.2.0.Final
 
+LICENSE=	GPLv2
+
 USE_GITHUB=	YES
 GH_ACCOUNT=	jbossas
 GH_PROJECT=	jboss-as

Modified: head/java/jboss72/distinfo
==============================================================================
--- head/java/jboss72/distinfo	Sat May  4 18:08:36 2013	(r317331)
+++ head/java/jboss72/distinfo	Sat May  4 18:27:34 2013	(r317332)
@@ -1,4 +1,4 @@
 SHA256 (m2-jboss-as-7.2.0.Final.tar.xz) = 64ec350d5ebb41d1fbe15f5ba18e37f94425007eba2dac407c2ad35128efa989
 SIZE (m2-jboss-as-7.2.0.Final.tar.xz) = 159788916
-SHA256 (jboss-as-7.2.0.Final.tar.gz) = e6de3007f7f260677626a2cb244183c80ea461735b5da568d10e02fe2f841e77
-SIZE (jboss-as-7.2.0.Final.tar.gz) = 14962672
+SHA256 (jboss-as-7.2.0.Final.tar.gz) = 5fd993b358e1650f91293bcc04f4b72fa81c0d25c775d689e30ea69fad294c32
+SIZE (jboss-as-7.2.0.Final.tar.gz) = 14956639

Modified: head/java/jboss72/files/jboss72.in
==============================================================================
--- head/java/jboss72/files/jboss72.in	Sat May  4 18:08:36 2013	(r317331)
+++ head/java/jboss72/files/jboss72.in	Sat May  4 18:27:34 2013	(r317332)
@@ -7,6 +7,7 @@
 
 # PROVIDE: %%APP_SHORTNAME%%
 # REQUIRE: NETWORKING SERVERS
+# KEYWORD: shutdown
 
 # Add the following lines to /etc/rc.conf to enable %%APP_SHORTNAME%%:
 # %%APP_SHORTNAME%%_enable (bool):      Set to "YES" to enable %%APP_SHORTNAME%%
@@ -17,9 +18,6 @@
 
 . /etc/rc.subr
 
-%%APP_SHORTNAME%%_user="%%USER%%"
-%%APP_SHORTNAME%%_logdir="%%LOG_DIR%%"
-
 name="%%APP_SHORTNAME%%"
 rcvar=%%APP_SHORTNAME%%_enable
 
@@ -27,6 +25,11 @@ load_rc_config $name
 
 %%APP_SHORTNAME%%_enable="${%%APP_SHORTNAME%%_enable:-"NO"}"
 %%APP_SHORTNAME%%_logging="${%%APP_SHORTNAME%%_logging:-">> ${%%APP_SHORTNAME%%_logdir}/stdout.log 2>> ${%%APP_SHORTNAME%%_logdir}/stderr.log"}"
+%%APP_SHORTNAME%%_sleep="${%%APP_SHORTNAME%%_sleep:-"5"}"
+%%APP_SHORTNAME%%_kill9="${%%APP_SHORTNAME%%_kill9:-""}"
+%%APP_SHORTNAME%%_additional_killall="${%%APP_SHORTNAME%%_additional_killall:-""}"
+%%APP_SHORTNAME%%_user="%%USER%%"
+%%APP_SHORTNAME%%_logdir="%%LOG_DIR%%"
 
 start_cmd="%%APP_SHORTNAME%%_start"
 stop_cmd="%%APP_SHORTNAME%%_stop"
@@ -38,14 +41,13 @@ JBOSS_HOME="%%APP_HOME%%"
 {
 	if [ ! -d "${%%APP_SHORTNAME%%_logdir}" ]
 	then
-		mkdir -p ${%%APP_SHORTNAME%%_logdir}
-		chown ${%%APP_SHORTNAME%%_user} ${%%APP_SHORTNAME%%_logdir}
+		install -d -o ${%%APP_SHORTNAME%%_user} ${%%APP_SHORTNAME%%_logdir}
 	fi
 
 	echo "Starting %%APP_SHORTNAME%%."
 	daemon -u ${%%APP_SHORTNAME%%_user} ${JBOSS_HOME}/bin/standalone.sh ${%%APP_SHORTNAME%%_logging} >> ${%%APP_SHORTNAME%%_logdir}/boot.log 2>> ${%%APP_SHORTNAME%%_logdir}/boot.log
 
-	sleep 1		# let daemon(8) and sh(1) finish before executing pgrep(1)
+	sleep ${%%APP_SHORTNAME%%_sleep}	# let daemon(8) and sh(1) finish before executing pgrep(1)
 	pgrep -U ${%%APP_SHORTNAME%%_user} -f ${JBOSS_HOME}/modules > ${pidfile}
 	chown ${%%APP_SHORTNAME%%_user} $pidfile
 }
@@ -56,6 +58,19 @@ JBOSS_HOME="%%APP_HOME%%"
 	if [ -f ${pidfile} ]
 	then
 		kill `cat ${pidfile}`
+		# Only if we aware that our setup can hangs, and only after trying simple kill, we can kill it hard way.
+		if [ ! -z "${%%APP_SHORTNAME%%_kill9}" ]
+		then
+			sleep ${%%APP_SHORTNAME%%_sleep}
+			kill  -9 `cat ${pidfile}`
+		fi
+		# In some setups, JBoss can spawn some child processess, which could prevent it from stopping, and freeing net ports.
+		# Let's blindly kill them all, since we are really know what we are doing.
+		if [ ! -z "${%%APP_SHORTNAME%%_additional_killall}" ]
+		then
+			sleep ${%%APP_SHORTNAME%%_sleep}
+			killall ${%%APP_SHORTNAME%%_additional_killall}
+		fi
 	fi
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201305041827.r44IRYm9088515>