Bug 178142 - java/jboss72 update of changed github tarballs plus enhance rc script
java/jboss72 update of changed github tarballs plus enhance rc script
Status: Closed FIXED
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s)
Latest
Any Any
: Normal Affects Only Me
Assigned To: Chris Rees
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-04-25 14:10 UTC by yerenkow
Modified: 2013-05-04 19:30 UTC (History)
0 users

See Also:


Attachments
file.shar (3.04 KB, text/plain)
2013-04-25 14:10 UTC, yerenkow
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description yerenkow 2013-04-25 14:10:00 UTC
jboss72 update of changed github tarballs plus enhance rc script:

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).

Fix: Patch attached with submission follows:
Comment 1 Edwin Groothuis freebsd_committer 2013-04-27 05:04:18 UTC
Class Changed
From-To: change-request->maintainer-update

Fix category (submitter is maintainer) (via the GNATS Auto Assign Tool)
Comment 2 Chris Rees freebsd_committer 2013-05-02 21:54:01 UTC
Responsible Changed
From-To: freebsd-ports-bugs->crees

I'll take it.
Comment 3 Chris Rees freebsd_committer 2013-05-02 22:14:13 UTC
State Changed
From-To: open->feedback

Hm, is this just half the patch?
Comment 4 yerenkow 2013-05-03 07:34:15 UTC
Yes, somehow there isn't new distinfo at all.
Here it is:


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) =
5fd993b358e1650f91293bcc04f4b72fa81c0d25c775d689e30ea69fad294c32
SIZE (jboss-as-7.2.0.Final.tar.gz) = 14956639


Also, while we are here - you could specify it's license:

GNU Lesser General Public License Version 2.1

Thanks!

-- 
Regards,
Alexander Yerenkow
Comment 5 dfilter freebsd_committer 2013-05-04 19:27:42 UTC
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
 }
 
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 6 Chris Rees freebsd_committer 2013-05-04 19:28:25 UTC
State Changed
From-To: feedback->closed

Committed. Thanks!