docker-install.sh does not expand ${{xxx}} values in .conf
files before using them to update target files. Consequently,
replaced LOGPATH with LOGSUFFIX in .conf files and updated
target files to use ${{POLICY_LOGS}}${{LOGSUFFIX}} instead.
Replace "${POLICY_HOME}/logs" in auxiliary files (e.g., logrotate)
with "${POLICY_LOGS}/policy".
Update license dates.
In .sh files, changed ${{POLICY_LOGS}} to ${POLICY_LOGS}, and
ensured that env.sh is sourced.
Use hard-coded paths in conf files instead of replacing
LOGPATH with LOGSUFFIX.
Update license dates.
Repoint path for IntegrityMonitor.log, as we cannot easily move
since it's in common.
Replace hard-coded log path in docker-install.sh.
Undo hard-coded log paths where possible, and modify scripts to
pass $POLICY_LOGS to JVM.
Change-Id: I027d8d2173ae97fef73b0daff1d6a87452857f93
Issue-ID: POLICY-759
Signed-off-by: Jim Hahn <jrh3@att.com>
14 files changed:
# ============LICENSE_START=======================================================
# ONAP Policy Engine
# ================================================================================
# ============LICENSE_START=======================================================
# ONAP Policy Engine
# ================================================================================
-# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+# Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
- echo "$(date +"%Y-%m-%d_%H-%M-%S") $1" >> ${POLICY_HOME}/logs/monitor.log
+ echo "$(date +"%Y-%m-%d_%H-%M-%S") $1" >> ${POLICY_LOGS}/policy/monitor.log
#============LICENSE_END==================================================
#
#============LICENSE_END==================================================
#
-${{POLICY_HOME}}/logs/elk.log {
+${{POLICY_LOGS}}/policy/elk.log {
#============LICENSE_END==================================================
#
#============LICENSE_END==================================================
#
-${{POLICY_HOME}}/logs/monitor.log {
+${{POLICY_LOGS}}/policy/monitor.log {
- echo "$(date +"%Y-%m-%d_%H-%M-%S") $1" >> ${POLICY_HOME}/logs/elk.log
+ echo "$(date +"%Y-%m-%d_%H-%M-%S") $1" >> ${POLICY_LOGS}/policy/elk.log
- $JAVA_HOME/bin/java -cp $POLICY_HOME/servers/pap/webapps/pap/WEB-INF/lib/ONAP-PAP-REST-*.jar:$POLICY_HOME/servers/pap/webapps/pap/WEB-INF/lib/*: -DPROPERTY_FILE=$POLICY_HOME/servers/pap/bin/policyelk.properties org.onap.policy.pap.xacml.rest.elk.client.ElasticSearchPolicyUpdate
+ $JAVA_HOME/bin/java -cp $POLICY_HOME/servers/pap/webapps/pap/WEB-INF/lib/ONAP-PAP-REST-*.jar:$POLICY_HOME/servers/pap/webapps/pap/WEB-INF/lib/*: -DPOLICY_LOGS=$POLICY_LOGS -DPROPERTY_FILE=$POLICY_HOME/servers/pap/bin/policyelk.properties org.onap.policy.pap.xacml.rest.elk.client.ElasticSearchPolicyUpdate
}
#########################################################################
}
#########################################################################
+. ${POLICY_HOME}/etc/profile.d/env.sh
+
case $OPERATION in
audit)
audit
case $OPERATION in
audit)
audit
-esac
\ No newline at end of file
-path.logs: ${{POLICY_HOME}}/logs
+path.logs: ${{POLICY_LOGS}}
#
# ----------------------------------- Memory -----------------------------------
#
#
# ----------------------------------- Memory -----------------------------------
#
JMX_JAVA_OPTS="${JMX_JAVA_OPTS} -Dcom.sun.management.jmxremote.ssl=false"
JMX_JAVA_OPTS="${JMX_JAVA_OPTS} -Dcom.sun.management.jmxremote.authenticate=false"
JMX_JAVA_OPTS="${JMX_JAVA_OPTS} -Dcom.sun.management.jmxremote.ssl=false"
JMX_JAVA_OPTS="${JMX_JAVA_OPTS} -Dcom.sun.management.jmxremote.authenticate=false"
+CMD_JAVA_OPTS="${CMD_JAVA_OPTS} -DPOLICY_LOGS=${POLICY_LOGS}"
+
RETVAL=0
function update_monitor() {
RETVAL=0
function update_monitor() {
- export ES_JAVA_OPTS="${JAVA_OPTS} ${JMX_JAVA_OPTS}"
+ export ES_JAVA_OPTS="${JAVA_OPTS} ${JMX_JAVA_OPTS} ${CMD_JAVA_OPTS}"
$POLICY_HOME/elk/bin/elasticsearch -d
RETVAL=$?
if [[ ${RETVAL} != 0 ]]; then
$POLICY_HOME/elk/bin/elasticsearch -d
RETVAL=$?
if [[ ${RETVAL} != 0 ]]; then
+. ${POLICY_HOME}/etc/profile.d/env.sh
+
case "$1" in
status)
pid=$(pgrep -f -u ${POLICY_USER} "${ELK_RUNNING}" 2> /dev/null)
case "$1" in
status)
pid=$(pgrep -f -u ${POLICY_USER} "${ELK_RUNNING}" 2> /dev/null)
# unmonitored start, does not change monitor status (immutable)
function um_start() {
# unmonitored start, does not change monitor status (immutable)
function um_start() {
- unset JMX_JAVA_OPTS JVM_SECURITY
+ unset JMX_JAVA_OPTS JVM_SECURITY CMD_JAVA_OPTS
JMX_JAVA_OPTS+=("-Dcom.sun.management.jmxremote")
JMX_JAVA_OPTS+=("-Dcom.sun.management.jmxremote.port=$BRMSGW_JMX_PORT")
JMX_JAVA_OPTS+=("-Dcom.sun.management.jmxremote.ssl=false")
JMX_JAVA_OPTS+=("-Dcom.sun.management.jmxremote")
JMX_JAVA_OPTS+=("-Dcom.sun.management.jmxremote.port=$BRMSGW_JMX_PORT")
JMX_JAVA_OPTS+=("-Dcom.sun.management.jmxremote.ssl=false")
JVM_SECURITY+=("-Djavax.net.ssl.keyStorePassword=${KEYSTORE_PASSWD}")
JVM_SECURITY+=("-Djavax.net.ssl.trustStore=${POLICY_HOME}/etc/ssl/policy-keystore")
JVM_SECURITY+=("-Djavax.net.ssl.trustStorePassword=${KEYSTORE_PASSWD}")
JVM_SECURITY+=("-Djavax.net.ssl.keyStorePassword=${KEYSTORE_PASSWD}")
JVM_SECURITY+=("-Djavax.net.ssl.trustStore=${POLICY_HOME}/etc/ssl/policy-keystore")
JVM_SECURITY+=("-Djavax.net.ssl.trustStorePassword=${KEYSTORE_PASSWD}")
+ CMD_JAVA_OPTS+=("-DPOLICY_LOGS=${POLICY_LOGS}")
- JAVA_OPTS=("${JVM_JAVA_OPTS[@]}" "${JMX_JAVA_OPTS[@]}" "${JVM_SECURITY[@]}")
+ JAVA_OPTS=("${JVM_JAVA_OPTS[@]}" "${JMX_JAVA_OPTS[@]}" "${JVM_SECURITY[@]}" "${CMD_JAVA_OPTS[@]}")
cd $POLICY_HOME/servers/brmsgw
mkdir -p $POLICY_LOGS/policy/brmsgw 2>/dev/null
cd $POLICY_HOME/servers/brmsgw
mkdir -p $POLICY_LOGS/policy/brmsgw 2>/dev/null
JMX_JAVA_OPTS="${JMX_JAVA_OPTS} -Dcom.sun.management.jmxremote.ssl=false"
JMX_JAVA_OPTS="${JMX_JAVA_OPTS} -Dcom.sun.management.jmxremote.authenticate=false"
JVM_JAVA_OPTS="-Xms${LOGPARSER_X_MS_MB}M -Xmx${LOGPARSER_X_MX_MB}M"
JMX_JAVA_OPTS="${JMX_JAVA_OPTS} -Dcom.sun.management.jmxremote.ssl=false"
JMX_JAVA_OPTS="${JMX_JAVA_OPTS} -Dcom.sun.management.jmxremote.authenticate=false"
JVM_JAVA_OPTS="-Xms${LOGPARSER_X_MS_MB}M -Xmx${LOGPARSER_X_MX_MB}M"
+
+ CMD_JAVA_OPTS="-DPOLICY_LOGS=${POLICY_LOGS}"
- JAVA_OPTS="${JAVA_OPTS} ${JMX_JAVA_OPTS} ${JVM_JAVA_OPTS}"
+ JAVA_OPTS="${JAVA_OPTS} ${JMX_JAVA_OPTS} ${JVM_JAVA_OPTS} ${CMD_JAVA_OPTS}"
# Redirects default and error output to a log file
cd ${POLICY_HOME}/servers/${COMPONENT}/bin
# Redirects default and error output to a log file
cd ${POLICY_HOME}/servers/${COMPONENT}/bin
# ============LICENSE_START=======================================================
# ONAP Policy Engine
# ================================================================================
# ============LICENSE_START=======================================================
# ONAP Policy Engine
# ================================================================================
-# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+# Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
CATALINA_OPTS="${CATALINA_OPTS} -Djavax.net.ssl.keyStorePassword=${KEYSTORE_PASSWD}"
CATALINA_OPTS="${CATALINA_OPTS} -Djavax.net.ssl.trustStore=${POLICY_HOME}/etc/ssl/policy-keystore"
CATALINA_OPTS="${CATALINA_OPTS} -Djavax.net.ssl.trustStorePassword=${KEYSTORE_PASSWD}"
CATALINA_OPTS="${CATALINA_OPTS} -Djavax.net.ssl.keyStorePassword=${KEYSTORE_PASSWD}"
CATALINA_OPTS="${CATALINA_OPTS} -Djavax.net.ssl.trustStore=${POLICY_HOME}/etc/ssl/policy-keystore"
CATALINA_OPTS="${CATALINA_OPTS} -Djavax.net.ssl.trustStorePassword=${KEYSTORE_PASSWD}"
+CATALINA_OPTS="${CATALINA_OPTS} -DPOLICY_LOGS=${POLICY_LOGS}"
CATALINA_OPTS="${CATALINA_OPTS} -Xms${{TOMCAT_X_MS_MB}}M"
CATALINA_OPTS="${CATALINA_OPTS} -Xmx${{TOMCAT_X_MX_MB}}M"
export CATALINA_OPTS
CATALINA_OPTS="${CATALINA_OPTS} -Xms${{TOMCAT_X_MS_MB}}M"
CATALINA_OPTS="${CATALINA_OPTS} -Xmx${{TOMCAT_X_MX_MB}}M"
export CATALINA_OPTS
# ============LICENSE_START=======================================================
# ONAP Policy Engine
# ================================================================================
# ============LICENSE_START=======================================================
# ONAP Policy Engine
# ================================================================================
-# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+# Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# PAP LogParser properties
# PAP LogParser properties
+POLICY_LOGS=${{POLICY_LOGS}}
+
# JVM specific parameters
LOGPARSER_JMX_PORT=${{LOGPARSER_JMX_PORT}}
LOGPARSER_X_MS_MB=${{LOGPARSER_X_MS_MB}}
# JVM specific parameters
LOGPARSER_JMX_PORT=${{LOGPARSER_JMX_PORT}}
LOGPARSER_X_MS_MB=${{LOGPARSER_X_MS_MB}}
JDBC_URL='${{JDBC_LOG_URL}}'
JDBC_USER=${{JDBC_USER}}
JDBC_PASSWORD=${{JDBC_PASSWORD}}
JDBC_URL='${{JDBC_LOG_URL}}'
JDBC_USER=${{JDBC_USER}}
JDBC_PASSWORD=${{JDBC_PASSWORD}}
-PARSERLOGPATH=IntegrityMonitor.log
+PARSERLOGPATH=${{PARSERLOGPATH}}
# run this cleanup systemlogdb table once a day
CHECK_INTERVAL=86400000
# timeFrame for removing old records from systemlogdb table
# run this cleanup systemlogdb table once a day
CHECK_INTERVAL=86400000
# timeFrame for removing old records from systemlogdb table
# ============LICENSE_START=======================================================
# ONAP Policy Engine
# ================================================================================
# ============LICENSE_START=======================================================
# ONAP Policy Engine
# ================================================================================
-# Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+# Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# PDP LogParser properties
# PDP LogParser properties
+POLICY_LOGS=${{POLICY_LOGS}}
+
# JVM specific parameters
LOGPARSER_JMX_PORT=${{LOGPARSER_JMX_PORT}}
LOGPARSER_X_MS_MB=${{LOGPARSER_X_MS_MB}}
# JVM specific parameters
LOGPARSER_JMX_PORT=${{LOGPARSER_JMX_PORT}}
LOGPARSER_X_MS_MB=${{LOGPARSER_X_MS_MB}}
JDBC_URL='${{JDBC_LOG_URL}}'
JDBC_USER=${{JDBC_USER}}
JDBC_PASSWORD=${{JDBC_PASSWORD}}
JDBC_URL='${{JDBC_LOG_URL}}'
JDBC_USER=${{JDBC_USER}}
JDBC_PASSWORD=${{JDBC_PASSWORD}}
-PARSERLOGPATH=IntegrityMonitor.log
+PARSERLOGPATH=${{PARSERLOGPATH}}
# run this cleanup systemlogdb table once a day
CHECK_INTERVAL=86400000
# timeFrame for removing old records from systemlogdb table
# run this cleanup systemlogdb table once a day
CHECK_INTERVAL=86400000
# timeFrame for removing old records from systemlogdb table
+ if ! /bin/mkdir -p "${POLICY_LOGS}" > /dev/null 2>&1; then
+ echo "error: aborting base installation: cannot create ${POLICY_LOGS}"
+ exit 1
+ fi
+
if ! /bin/mkdir -p "${POLICY_HOME}/logs/" > /dev/null 2>&1; then
echo "error: aborting base installation: cannot create ${POLICY_HOME}/logs/"
exit 1
if ! /bin/mkdir -p "${POLICY_HOME}/logs/" > /dev/null 2>&1; then
echo "error: aborting base installation: cannot create ${POLICY_HOME}/logs/"
exit 1
LOGPARSER_X_MX_MB=1024
SERVER=https://${{FQDN}}:9091/pap/
LOGPARSER_X_MX_MB=1024
SERVER=https://${{FQDN}}:9091/pap/
-LOGPATH=${{POLICY_LOGS}}/policy/pap/pap-rest.log
-PARSERLOGPATH=${{POLICY_LOGS}}/policy/pap/IntegrityMonitor.log
+LOGPATH=${{POLICY_HOME}}/logs/policy/pap/pap-rest.log
+PARSERLOGPATH=${{POLICY_HOME}}/servers/paplp/bin/IntegrityMonitor.log
node_type=logparser
# the java property is RESOURCE_NAME (uppercase), but the conf parameter is lowercase
node_type=logparser
# the java property is RESOURCE_NAME (uppercase), but the conf parameter is lowercase
LOGPARSER_X_MX_MB=1024
SERVER=https://${{FQDN}}:8081/pdp/
LOGPARSER_X_MX_MB=1024
SERVER=https://${{FQDN}}:8081/pdp/
-LOGPATH=${{POLICY_LOGS}}/policy/pdpx/pdp-rest.log
-PARSERLOGPATH=${{POLICY_LOGS}}/policy/pdpx/IntegrityMonitor.log
+LOGPATH=${{POLICY_HOME}}/logs/policy/pdpx/pdp-rest.log
+PARSERLOGPATH=${{POLICY_HOME}}/servers/pdplp/bin/IntegrityMonitor.log
node_type=logparser
# the java property is RESOURCE_NAME (uppercase), but the conf parameter is lowercase
node_type=logparser
# the java property is RESOURCE_NAME (uppercase), but the conf parameter is lowercase