Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 18 Apr 2019 09:03:10 +0000 (UTC)
From:      Tobias Kortkamp <tobik@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r499241 - in head/net/activemq: . files
Message-ID:  <201904180903.x3I93AHr092779@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: tobik
Date: Thu Apr 18 09:03:10 2019
New Revision: 499241
URL: https://svnweb.freebsd.org/changeset/ports/499241

Log:
  net/activemq: Fix rc script stop command
  
  The stop command fails because it cannot connect to activemq, so
  the rc script currently always kills activemq which might lead to
  lost data, database corruption, left-over lock files, etc.  Run the
  stop command under the activemq user too like the jps command in
  activemq_check_pidfile() so that it can actually shutdown activemq.
  
  - While here fix log files location
  
  PR:		207881
  Reported by:	bwilliamson@bex.net

Added:
  head/net/activemq/files/patch-conf_log4j.properties   (contents, props changed)
Modified:
  head/net/activemq/Makefile
  head/net/activemq/files/activemq.in

Modified: head/net/activemq/Makefile
==============================================================================
--- head/net/activemq/Makefile	Thu Apr 18 08:26:44 2019	(r499240)
+++ head/net/activemq/Makefile	Thu Apr 18 09:03:10 2019	(r499241)
@@ -2,6 +2,7 @@
 
 PORTNAME=	activemq
 PORTVERSION=	5.15.9
+PORTREVISION=	1
 CATEGORIES=	net java
 MASTER_SITES=	APACHE/${PORTNAME}/${PORTVERSION}
 DISTNAME=	apache-${PORTNAME}-${PORTVERSION}
@@ -43,12 +44,9 @@ PLIST_SUB=	MQUSER="${MQUSER}" \
 
 OPTIONS_DEFINE=	DOCS EXAMPLES
 
-post-patch:
-	@${REINPLACE_CMD} -i '' -e 's|activemq.base}/data|activemq.logs}|g' \
-		${WRKSRC}/conf/log4j.properties
-	       
 do-install:
 	@${MKDIR} ${STAGEDIR}${DATADIR}/bin ${STAGEDIR}${ETCDIR} ${STAGEDIR}${MQDB}
+	${RM} ${WRKSRC}/conf/log4j.properties.orig
 	cd ${WRKSRC}/conf && for f in *; do \
 		${INSTALL_DATA} ${WRKSRC}/conf/$$f ${STAGEDIR}${ETCDIR}/$$f.sample; \
 	done

Modified: head/net/activemq/files/activemq.in
==============================================================================
--- head/net/activemq/files/activemq.in	Thu Apr 18 08:26:44 2019	(r499240)
+++ head/net/activemq/files/activemq.in	Thu Apr 18 09:03:10 2019	(r499241)
@@ -85,7 +85,7 @@ activemq_stop() {
 	fi
 	
 	echo "Stopping ${name}."
-	${java_command} stop >/dev/null
+	/usr/bin/su -m $activemq_user -c "${java_command} stop" >/dev/null
 	activemq_wait_max_for_pid ${activemq_stop_timeout} ${rc_pid}
 	kill -KILL ${rc_pid} 2> /dev/null && echo "Killed."
 	rm -f ${pidfile}

Added: head/net/activemq/files/patch-conf_log4j.properties
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net/activemq/files/patch-conf_log4j.properties	Thu Apr 18 09:03:10 2019	(r499241)
@@ -0,0 +1,20 @@
+--- conf/log4j.properties.orig	2019-03-15 12:04:19 UTC
++++ conf/log4j.properties
+@@ -44,7 +44,7 @@ log4j.appender.console.threshold=INFO
+ 
+ # File appender
+ log4j.appender.logfile=org.apache.log4j.RollingFileAppender
+-log4j.appender.logfile.file=${activemq.data}/activemq.log
++log4j.appender.logfile.file=${activemq.logs}/activemq.log
+ log4j.appender.logfile.maxFileSize=1024KB
+ log4j.appender.logfile.maxBackupIndex=5
+ log4j.appender.logfile.append=true
+@@ -70,7 +70,7 @@ log4j.additivity.org.apache.activemq.audit=false
+ log4j.logger.org.apache.activemq.audit=INFO, audit
+ 
+ log4j.appender.audit=org.apache.log4j.RollingFileAppender
+-log4j.appender.audit.file=${activemq.data}/audit.log
++log4j.appender.audit.file=${activemq.logs}/audit.log
+ log4j.appender.audit.maxFileSize=1024KB
+ log4j.appender.audit.maxBackupIndex=5
+ log4j.appender.audit.append=true



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