mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-29 05:38:00 +00:00
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
This commit is contained in:
parent
41697cac5f
commit
08758dfc3b
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=499241
@ -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
|
||||
|
@ -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}
|
||||
|
20
net/activemq/files/patch-conf_log4j.properties
Normal file
20
net/activemq/files/patch-conf_log4j.properties
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user