summaryrefslogtreecommitdiff
path: root/java/jboss72
diff options
context:
space:
mode:
authorChris Rees <crees@FreeBSD.org>2013-05-04 18:27:34 +0000
committerChris Rees <crees@FreeBSD.org>2013-05-04 18:27:34 +0000
commitfcbe3244896e82af6eb592b5cdc9c1a3b2f770f1 (patch)
treec250d03b2233afd740a1775ae60820f1ad40ae37 /java/jboss72
parentUpdate to 1.117. (diff)
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)
Diffstat (limited to 'java/jboss72')
-rw-r--r--java/jboss72/Makefile4
-rw-r--r--java/jboss72/distinfo4
-rw-r--r--java/jboss72/files/jboss72.in27
3 files changed, 26 insertions, 9 deletions
diff --git a/java/jboss72/Makefile b/java/jboss72/Makefile
index a3177911d1a5..d49c1a480c0c 100644
--- a/java/jboss72/Makefile
+++ b/java/jboss72/Makefile
@@ -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 ${DISTNAME}.tar.gz
MAINTAINER= yerenkow@gmail.com
COMMENT= JBoss 7.2.0.Final
+LICENSE= GPLv2
+
USE_GITHUB= YES
GH_ACCOUNT= jbossas
GH_PROJECT= jboss-as
diff --git a/java/jboss72/distinfo b/java/jboss72/distinfo
index e914426a1cf7..2554e1b3f5eb 100644
--- a/java/jboss72/distinfo
+++ b/java/jboss72/distinfo
@@ -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
diff --git a/java/jboss72/files/jboss72.in b/java/jboss72/files/jboss72.in
index f8f01ec4227f..61f0293bf62e 100644
--- a/java/jboss72/files/jboss72.in
+++ b/java/jboss72/files/jboss72.in
@@ -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
}