Imp: add plugins log configuration
@@ -41,6 +41,10 @@ OPENBATON_BASE_DIR=/usr
OPENBATON_COMPONENT_EXE_DIR=${OPENBATON_BASE_DIR}/bin
OPENBATON_PLUGINS_DIR=${OPENBATON_BASE_DIR}/lib/openbaton/plugins/vim-drivers
+OPENBATON_LOG_DIR="/var/log/openbaton"
+OPENBATON_PLUGINS_LOG_DIR="plugins"
+OPENBATON_PLUGINS_LOG_DIR_ABSOLUTE="${OPENBATON_LOG_DIR}/${OPENBATON_PLUGINS_LOG_DIR}"
+
OPENBATON_BASE_CONFIG_DIR=/etc/openbaton
OPENBATON_COMPONENT_CONFIG_FILE=openbaton-${OPENBATON_COMPONENT_NAME}.properties
@@ -117,6 +121,16 @@ set_plugins_folder () {
sed -i "s|nfvo.plugin.installation-dir\s*=\s*./plugins|nfvo.plugin.installation-dir=${OPENBATON_PLUGINS_DIR}|g" /etc/openbaton/openbaton-${OPENBATON_COMPONENT_NAME}.properties
}
+set_plugins_log_folder () {
+ export OPENBATON_PLUGINS_LOG_DIR_ABSOLUTE=${OPENBATON_PLUGINS_LOG_DIR_ABSOLUTE}
+
+ log_success_msg "Creating directory for Plugins logs"
+ mkdir -p ${OPENBATON_PLUGINS_LOG_DIR_ABSOLUTE}
+
+ log_success_msg "Configuring directory for Plugins logs"
+ sed -i "s|nfvo.plugin.log.path\s*=\s*.*|nfvo.plugin.log.path=${OPENBATON_PLUGINS_LOG_DIR_ABSOLUTE}|g" /etc/openbaton/openbaton-${OPENBATON_COMPONENT_NAME}.properties
+}
+
configure_nfvo_admin_credentials () {
# In case of "noninteractive" FRONTEND either the value from the configuration file or the default value will be used (DEFAULT: openbaton_admin_password=openbaton)
if [ "${DEBIAN_FRONTEND}" != "Noninteractive" -a "${DEBIAN_FRONTEND}" != "noninteractive" ]; then
@@ -149,6 +163,7 @@ configure_new_installation () {
configure_rabbitmq
fi
set_plugins_folder
+ set_plugins_log_folder
configure_nfvo_admin_credentials
chmod a+x ${OPENBATON_COMPONENT_EXE_DIR}/openbaton-${OPENBATON_COMPONENT_NAME}
log_success_msg "Open Baton ${OPENBATON_COMPONENT_NAME_FANCY} installation completed"
