Merge "Add msb environment to oom"
[oom.git] / kubernetes / appc / resources / config / appc / opt / onap / appc / bin / startODL.sh
index 64cf3d9..c52c6e3 100755 (executable)
@@ -111,8 +111,6 @@ then
 #        echo "Copying a working version of the logging configuration into the opendaylight etc folder"
 #        cp ${APPC_HOME}/data/org.ops4j.pax.logging.cfg ${ODL_HOME}/etc/org.ops4j.pax.logging.cfg
 
-        echo "Starting OpenDaylight"
-        ${ODL_HOME}/bin/start
 
         echo "Waiting ${SLEEP_TIME} seconds for OpenDaylight to initialize"
         sleep ${SLEEP_TIME}
@@ -132,11 +130,12 @@ then
 
         if $ENABLE_ODL_CLUSTER
         then
-                echo "Installing Opendaylight cluster features"
+                echo "Enabling Opendaylight cluster features"
                 enable_odl_cluster
         fi
 
         echo "Copying the aaa shiro configuration into opendaylight"
+        mkdir -p ${ODL_HOME}/etc/opendaylight/datastore/initial/config
         if $ENABLE_AAF
         then
              cp ${APPC_HOME}/data/properties/aaa-app-config.xml ${ODL_HOME}/etc/opendaylight/datastore/initial/config/aaa-app-config.xml
@@ -144,16 +143,6 @@ then
              cp ${APPC_HOME}/data/aaa-app-config.xml ${ODL_HOME}/etc/opendaylight/datastore/initial/config/aaa-app-config.xml
         fi
 
-        echo "Restarting OpenDaylight"
-        echo "Stopping OpenDaylight and waiting for it to stop"
-        ${ODL_HOME}/bin/stop
-        #The karaf command will exit when odl shuts down. This is the most reliable way to wait for opendaylight to stop
-        #before exiting the docker container.
-        ${ODL_HOME}/bin/karaf
-        echo "Karaf process has stopped"
-        sleep 10s
-
-        echo "Installed at `date`" > ${SDNC_HOME}/.installed
 fi
 
 # Move journal and snapshots directory to persistent storage
@@ -182,5 +171,27 @@ ln -s ${hostdir}/snapshots ${ODL_HOME}/snapshots
 echo "Starting cdt-proxy-service jar, logging to ${APPC_HOME}/cdt-proxy-service/jar.log"
 java -jar ${APPC_HOME}/cdt-proxy-service/cdt-proxy-service.jar > ${APPC_HOME}/cdt-proxy-service/jar.log &
 
-exec ${ODL_HOME}/bin/karaf server
+echo "Adding a property system.properties for AAF cadi.properties location"
+echo "" >> ${ODL_HOME}/etc/system.properties
+echo "cadi_prop_files=${APPC_HOME}/data/properties/cadi.properties" >> ${ODL_HOME}/etc/system.properties
+echo "" >> ${ODL_HOME}/etc/system.properties
+
+echo "Adding a value to property appc.asdc.env in appc.properties for appc-asdc-listener feature"
+echo "" >> $APPC_HOME/data/properties/appc.properties
+echo "appc.asdc.env=$DMAAP_TOPIC_ENV" >> $APPC_HOME/data/properties/appc.properties
+echo "" >> $APPC_HOME/data/properties/appc.properties
+
+echo "Copying jetty, keystore for https into opendalight"
+cp ${APPC_HOME}/data/jetty.xml ${ODL_HOME}/etc/jetty.xml
+cp ${APPC_HOME}/data/keystore ${ODL_HOME}/etc/keystore
+cp ${APPC_HOME}/data/custom.properties ${ODL_HOME}/etc/custom.properties
 
+echo "Copying a working version of the logging configuration into the opendaylight etc folder"
+cp ${APPC_HOME}/data/org.ops4j.pax.logging.cfg ${ODL_HOME}/etc/org.ops4j.pax.logging.cfg
+
+ODL_BOOT_FEATURES_EXTRA="odl-netconf-connector,odl-restconf-noauth,odl-netconf-clustered-topology,odl-mdsal-clustering"
+sed -i -e "\|featuresBoot[^a-zA-Z]|s|$|,${ODL_BOOT_FEATURES_EXTRA}|"  $ODL_HOME/etc/org.apache.karaf.features.cfg
+
+exec ${APPC_HOME}/bin/dockerInstall.sh &
+echo "Starting OpenDaylight"
+exec ${ODL_HOME}/bin/karaf server