aboutsummaryrefslogtreecommitdiff
path: root/net/activemq
diff options
context:
space:
mode:
authorTobias Kortkamp <tobik@FreeBSD.org>2019-04-18 09:03:10 +0000
committerTobias Kortkamp <tobik@FreeBSD.org>2019-04-18 09:03:10 +0000
commit08758dfc3bf9a90c2235c76fd442593e41cce60a (patch)
treef23ba512d521834c4d5fff0fc876cec01e84ed85 /net/activemq
parent41697cac5fdeb6de21855436c63a52b20a7b265d (diff)
downloadports-08758dfc3bf9a90c2235c76fd442593e41cce60a.tar.gz
ports-08758dfc3bf9a90c2235c76fd442593e41cce60a.zip
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
Notes
Notes: svn path=/head/; revision=499241
Diffstat (limited to 'net/activemq')
-rw-r--r--net/activemq/Makefile6
-rw-r--r--net/activemq/files/activemq.in2
-rw-r--r--net/activemq/files/patch-conf_log4j.properties20
3 files changed, 23 insertions, 5 deletions
diff --git a/net/activemq/Makefile b/net/activemq/Makefile
index 4516a86102a3..bb45016b8592 100644
--- a/net/activemq/Makefile
+++ b/net/activemq/Makefile
@@ -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
diff --git a/net/activemq/files/activemq.in b/net/activemq/files/activemq.in
index f4f14dfef713..7ca822801519 100644
--- a/net/activemq/files/activemq.in
+++ b/net/activemq/files/activemq.in
@@ -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}
diff --git a/net/activemq/files/patch-conf_log4j.properties b/net/activemq/files/patch-conf_log4j.properties
new file mode 100644
index 000000000000..77323fdac287
--- /dev/null
+++ b/net/activemq/files/patch-conf_log4j.properties
@@ -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