Cleanup ONAP installation via Heat 57/58757/1
authorMarco Platania <platania@research.att.com>
Thu, 2 Aug 2018 17:02:59 +0000 (13:02 -0400)
committerMarco Platania <platania@research.att.com>
Thu, 2 Aug 2018 17:02:59 +0000 (13:02 -0400)
- Remove all the parts of code related to deprecated configurations
- Consolidate serv.sh scripts in a single one
- Allow SO resolution via DNS (in addition to MSO)

Change-Id: I6cabacdabaa3c5158ee101057738584922858fc9
Issue-ID: INT-526
Signed-off-by: Marco Platania <platania@research.att.com>
40 files changed:
boot/aaf_install.sh
boot/aaf_serv.sh [deleted file]
boot/aai_install.sh
boot/aai_serv.sh [deleted file]
boot/appc_install.sh
boot/appc_serv.sh [deleted file]
boot/clamp_install.sh
boot/clamp_serv.sh [deleted file]
boot/db_simpledemo_onap_org
boot/db_simpledemo_openecomp_org
boot/dcae2_install.sh
boot/dcae2_serv.sh [deleted file]
boot/dns_install.sh
boot/docker_key.txt [deleted file]
boot/mr_install.sh
boot/mr_serv.sh [deleted file]
boot/music_install.sh
boot/music_serv.sh [deleted file]
boot/nbi_install.sh
boot/nbi_serv.sh [deleted file]
boot/oof_install.sh
boot/oof_serv.sh [deleted file]
boot/openo_install.sh
boot/openo_serv.sh [deleted file]
boot/policy_install.sh
boot/policy_serv.sh [deleted file]
boot/portal_install.sh
boot/portal_serv.sh [deleted file]
boot/robot_install.sh
boot/robot_serv.sh [deleted file]
boot/sdc_install.sh
boot/sdc_serv.sh [deleted file]
boot/sdnc_install.sh
boot/sdnc_serv.sh [deleted file]
boot/serv.sh [moved from boot/so_serv.sh with 99% similarity]
boot/sms_install.sh
boot/sms_serv.sh [deleted file]
boot/so_install.sh
boot/vid_install.sh
boot/vid_serv.sh [deleted file]

index c8531d5..171592c 100644 (file)
@@ -27,34 +27,6 @@ then
        cp /home/ubuntu/.ssh/authorized_keys /root/.ssh
 fi
 
-# Set private IP in /etc/network/interfaces manually in the presence of public interface
-# Some VM images don't add the private interface automatically, we have to do it during the component installation
-if [[ $CLOUD_ENV == "openstack_nofloat" ]]
-then
-       LOCAL_IP=$(cat /opt/config/local_ip_addr.txt)
-       CIDR=$(cat /opt/config/oam_network_cidr.txt)
-       BITMASK=$(echo $CIDR | cut -d"/" -f2)
-
-       # Compute the netmask based on the network cidr
-       if [[ $BITMASK == "8" ]]
-       then
-               NETMASK=255.0.0.0
-       elif [[ $BITMASK == "16" ]]
-       then
-               NETMASK=255.255.0.0
-       elif [[ $BITMASK == "24" ]]
-       then
-               NETMASK=255.255.255.0
-       fi
-
-       echo "auto eth1" >> /etc/network/interfaces
-       echo "iface eth1 inet static" >> /etc/network/interfaces
-       echo "    address $LOCAL_IP" >> /etc/network/interfaces
-       echo "    netmask $NETMASK" >> /etc/network/interfaces
-       echo "    mtu $MTU" >> /etc/network/interfaces
-       ifup eth1
-fi
-
 # Download dependencies
 echo "deb http://ppa.launchpad.net/openjdk-r/ppa/ubuntu $(lsb_release -c -s) main" >>  /etc/apt/sources.list.d/java.list
 echo "deb-src http://ppa.launchpad.net/openjdk-r/ppa/ubuntu $(lsb_release -c -s) main" >>  /etc/apt/sources.list.d/java.list
@@ -63,11 +35,12 @@ apt-get install --allow-unauthenticated -y apt-transport-https ca-certificates w
 
 # Download scripts from Nexus
 unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip aaf_vm_init.sh > /opt/aaf_vm_init.sh
-unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip aaf_serv.sh > /opt/aaf_serv.sh
+unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip serv.sh > /opt/aaf_serv.sh
 unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip imagetest.sh > /opt/imagetest.sh
 chmod +x /opt/imagetest.sh
 chmod +x /opt/aaf_vm_init.sh
 chmod +x /opt/aaf_serv.sh
+sed -i "s|cmd=\"\"|cmd=\"./aaf_vm_init.sh\"|g" /opt/aaf_serv.sh
 mv /opt/aaf_serv.sh /etc/init.d
 update-rc.d aaf_serv.sh defaults
 
@@ -115,8 +88,6 @@ chmod +x /opt/authz/auth/docker/dbuild.sh
 chmod +x /opt/authz/auth/docker/drun.sh
 chmod +x /opt/authz/auth/docker/dstart.sh
 chmod +x /opt/authz/auth/docker/dstop.sh
-# d.props is not a startable shell
-# chmod +x /opt/authz/auth/docker/d.props
 
 #Update maven settings
 cat > /usr/share/maven/conf/settings.xml << EOF
@@ -527,17 +498,5 @@ EOF
 cd /opt/authz
 mvn install -Dmaven.test.skip=true
 
-# Rename network interface in openstack Ubuntu 16.04 images. Then, reboot the VM to pick up changes
-if [[ $CLOUD_ENV != "rackspace" ]]
-then
-       sed -i "s/GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX=\"net.ifnames=0 biosdevname=0\"/g" /etc/default/grub
-       grub-mkconfig -o /boot/grub/grub.cfg
-       sed -i "s/ens[0-9]*/eth0/g" /etc/network/interfaces.d/*.cfg
-       sed -i "s/ens[0-9]*/eth0/g" /etc/udev/rules.d/70-persistent-net.rules
-       echo 'network: {config: disabled}' >> /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
-       echo "APT::Periodic::Unattended-Upgrade \"0\";" >> /etc/apt/apt.conf.d/10periodic
-       reboot
-fi
-
 cd /opt
 ./aaf_vm_init.sh
diff --git a/boot/aaf_serv.sh b/boot/aaf_serv.sh
deleted file mode 100644 (file)
index 597969b..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-#!/bin/sh
-### BEGIN INIT INFO
-# Provides:
-# Required-Start:    $remote_fs $syslog
-# Required-Stop:     $remote_fs $syslog
-# Default-Start:     2 3 4 5
-# Default-Stop:      0 1 6
-# Short-Description: Start daemon at boot time
-# Description:       Enable service provided by daemon.
-### END INIT INFO
-
-HTTP_PROXY=$(cat /opt/config/http_proxy.txt)
-HTTPS_PROXY=$(cat /opt/config/https_proxy.txt)
-
-if [ $HTTP_PROXY != "no_proxy" ]
-then
-    export http_proxy=$HTTP_PROXY
-    export https_proxy=$HTTPS_PROXY
-fi
-
-dir="/opt"
-cmd="./aaf_vm_init.sh"
-user="root"
-
-name=`basename $0`
-pid_file="/var/run/$name.pid"
-stdout_log="/var/log/$name.log"
-stderr_log="/var/log/$name.err"
-
-get_pid() {
-    cat "$pid_file"
-}
-
-is_running() {
-    [ -f "$pid_file" ] && ps `get_pid` > /dev/null 2>&1
-}
-
-case "$1" in
-    start)
-    if is_running; then
-        echo "Already started"
-    else
-        echo "Starting $name"
-        cd "$dir"
-        if [ -z "$user" ]; then
-            sudo $cmd >> "$stdout_log" 2>> "$stderr_log" &
-        else
-            sudo -u "$user" $cmd >> "$stdout_log" 2>> "$stderr_log" &
-        fi
-        echo $! > "$pid_file"
-        if ! is_running; then
-            echo "Unable to start, see $stdout_log and $stderr_log"
-            exit 1
-        fi
-    fi
-    ;;
-    stop)
-    if is_running; then
-        echo -n "Stopping $name.."
-        kill `get_pid`
-        for i in {1..10}
-        do
-            if ! is_running; then
-                break
-            fi
-
-            echo -n "."
-            sleep 1
-        done
-        echo
-
-        if is_running; then
-            echo "Not stopped; may still be shutting down or shutdown may have failed"
-            exit 1
-        else
-            echo "Stopped"
-            if [ -f "$pid_file" ]; then
-                rm "$pid_file"
-            fi
-        fi
-    else
-        echo "Not running"
-    fi
-    ;;
-    restart)
-    $0 stop
-    if is_running; then
-        echo "Unable to stop, will not attempt to start"
-        exit 1
-    fi
-    $0 start
-    ;;
-    status)
-    if is_running; then
-        echo "Running"
-    else
-        echo "Stopped"
-        exit 1
-    fi
-    ;;
-    *)
-    echo "Usage: $0 {start|stop|restart|status}"
-    exit 1
-    ;;
-esac
-
-exit 0
index 83450e3..b238fd6 100644 (file)
@@ -27,45 +27,18 @@ then
        cp /home/ubuntu/.ssh/authorized_keys /root/.ssh
 fi
 
-# Set private IP in /etc/network/interfaces manually in the presence of public interface
-# Some VM images don't add the private interface automatically, we have to do it during the component installation
-if [[ $CLOUD_ENV == "openstack_nofloat" ]]
-then
-       LOCAL_IP=$(cat /opt/config/local_ip_addr.txt)
-       CIDR=$(cat /opt/config/oam_network_cidr.txt)
-       BITMASK=$(echo $CIDR | cut -d"/" -f2)
-
-       # Compute the netmask based on the network cidr
-       if [[ $BITMASK == "8" ]]
-       then
-               NETMASK=255.0.0.0
-       elif [[ $BITMASK == "16" ]]
-       then
-               NETMASK=255.255.0.0
-       elif [[ $BITMASK == "24" ]]
-       then
-               NETMASK=255.255.255.0
-       fi
-
-       echo "auto eth1" >> /etc/network/interfaces
-       echo "iface eth1 inet static" >> /etc/network/interfaces
-       echo "    address $LOCAL_IP" >> /etc/network/interfaces
-       echo "    netmask $NETMASK" >> /etc/network/interfaces
-       echo "    mtu $MTU" >> /etc/network/interfaces
-       ifup eth1
-fi
-
 # Download dependencies
 apt-get update
 apt-get install -y apt-transport-https ca-certificates wget git ntp ntpdate make
 
 # Download scripts from Nexus
 unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip aai_vm_init.sh > /opt/aai_vm_init.sh
-unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip aai_serv.sh > /opt/aai_serv.sh
+unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip serv.sh > /opt/aai_serv.sh
 unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip imagetest.sh > /opt/imagetest.sh
 chmod +x /opt/imagetest.sh
 chmod +x /opt/aai_vm_init.sh
 chmod +x /opt/aai_serv.sh
+sed -i "s|cmd=\"\"|cmd=\"./aai_vm_init.sh\"|g" /opt/aai_serv.sh
 mv /opt/aai_serv.sh /etc/init.d
 update-rc.d aai_serv.sh defaults
 
diff --git a/boot/aai_serv.sh b/boot/aai_serv.sh
deleted file mode 100644 (file)
index 09949bb..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-#!/bin/sh
-### BEGIN INIT INFO
-# Provides:
-# Required-Start:    $remote_fs $syslog
-# Required-Stop:     $remote_fs $syslog
-# Default-Start:     2 3 4 5
-# Default-Stop:      0 1 6
-# Short-Description: Start daemon at boot time
-# Description:       Enable service provided by daemon.
-### END INIT INFO
-HTTP_PROXY=$(cat /opt/config/http_proxy.txt)
-HTTPS_PROXY=$(cat /opt/config/https_proxy.txt)
-
-if [ $HTTP_PROXY != "no_proxy" ]
-then
-    export http_proxy=$HTTP_PROXY
-    export https_proxy=$HTTPS_PROXY
-fi
-
-dir="/opt"
-cmd="./aai_vm_init.sh"
-user="root"
-
-name=`basename $0`
-pid_file="/var/run/$name.pid"
-stdout_log="/var/log/$name.log"
-stderr_log="/var/log/$name.err"
-
-get_pid() {
-    cat "$pid_file"
-}
-
-is_running() {
-    [ -f "$pid_file" ] && ps `get_pid` > /dev/null 2>&1
-}
-
-case "$1" in
-    start)
-    if is_running; then
-        echo "Already started"
-    else
-        echo "Starting $name"
-        cd "$dir"
-        if [ -z "$user" ]; then
-            sudo $cmd >> "$stdout_log" 2>> "$stderr_log" &
-        else
-            sudo -u "$user" $cmd >> "$stdout_log" 2>> "$stderr_log" &
-        fi
-        echo $! > "$pid_file"
-        if ! is_running; then
-            echo "Unable to start, see $stdout_log and $stderr_log"
-            exit 1
-        fi
-    fi
-    ;;
-    stop)
-    if is_running; then
-        echo -n "Stopping $name.."
-        kill `get_pid`
-        for i in {1..10}
-        do
-            if ! is_running; then
-                break
-            fi
-
-            echo -n "."
-            sleep 1
-        done
-        echo
-
-        if is_running; then
-            echo "Not stopped; may still be shutting down or shutdown may have failed"
-            exit 1
-        else
-            echo "Stopped"
-            if [ -f "$pid_file" ]; then
-                rm "$pid_file"
-            fi
-        fi
-    else
-        echo "Not running"
-    fi
-    ;;
-    restart)
-    $0 stop
-    if is_running; then
-        echo "Unable to stop, will not attempt to start"
-        exit 1
-    fi
-    $0 start
-    ;;
-    status)
-    if is_running; then
-        echo "Running"
-    else
-        echo "Stopped"
-        exit 1
-    fi
-    ;;
-    *)
-    echo "Usage: $0 {start|stop|restart|status}"
-    exit 1
-    ;;
-esac
-
-exit 0
index c66b12a..e871bfc 100644 (file)
@@ -26,45 +26,18 @@ then
        cp /home/ubuntu/.ssh/authorized_keys /root/.ssh
 fi
 
-# Set private IP in /etc/network/interfaces manually in the presence of public interface
-# Some VM images don't add the private interface automatically, we have to do it during the component installation
-if [[ $CLOUD_ENV == "openstack_nofloat" ]]
-then
-       LOCAL_IP=$(cat /opt/config/local_ip_addr.txt)
-       CIDR=$(cat /opt/config/oam_network_cidr.txt)
-       BITMASK=$(echo $CIDR | cut -d"/" -f2)
-
-       # Compute the netmask based on the network cidr
-       if [[ $BITMASK == "8" ]]
-       then
-               NETMASK=255.0.0.0
-       elif [[ $BITMASK == "16" ]]
-       then
-               NETMASK=255.255.0.0
-       elif [[ $BITMASK == "24" ]]
-       then
-               NETMASK=255.255.255.0
-       fi
-
-       echo "auto eth1" >> /etc/network/interfaces
-       echo "iface eth1 inet static" >> /etc/network/interfaces
-       echo "    address $LOCAL_IP" >> /etc/network/interfaces
-       echo "    netmask $NETMASK" >> /etc/network/interfaces
-       echo "    mtu $MTU" >> /etc/network/interfaces
-       ifup eth1
-fi
-
 # Download dependencies
 apt-get update
 apt-get install -y apt-transport-https ca-certificates wget git ntp ntpdate make
 
 # Download scripts from Nexus
 unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip appc_vm_init.sh > /opt/appc_vm_init.sh
-unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip appc_serv.sh > /opt/appc_serv.sh
+unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip serv.sh > /opt/appc_serv.sh
 unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip imagetest.sh > /opt/imagetest.sh
 chmod +x /opt/imagetest.sh
 chmod +x /opt/appc_vm_init.sh
 chmod +x /opt/appc_serv.sh
+sed -i "s|cmd=\"\"|cmd=\"./appc_vm_init.sh\"|g" /opt/appc_serv.sh
 mv /opt/appc_serv.sh /etc/init.d
 update-rc.d appc_serv.sh defaults
 
diff --git a/boot/appc_serv.sh b/boot/appc_serv.sh
deleted file mode 100644 (file)
index 6947b9f..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-#!/bin/sh
-### BEGIN INIT INFO
-# Provides:
-# Required-Start:    $remote_fs $syslog
-# Required-Stop:     $remote_fs $syslog
-# Default-Start:     2 3 4 5
-# Default-Stop:      0 1 6
-# Short-Description: Start daemon at boot time
-# Description:       Enable service provided by daemon.
-### END INIT INFO
-HTTP_PROXY=$(cat /opt/config/http_proxy.txt)
-HTTPS_PROXY=$(cat /opt/config/https_proxy.txt)
-
-if [ $HTTP_PROXY != "no_proxy" ]
-then
-    export http_proxy=$HTTP_PROXY
-    export https_proxy=$HTTPS_PROXY
-fi
-
-dir="/opt"
-cmd="./appc_vm_init.sh"
-user="root"
-
-name=`basename $0`
-pid_file="/var/run/$name.pid"
-stdout_log="/var/log/$name.log"
-stderr_log="/var/log/$name.err"
-
-get_pid() {
-    cat "$pid_file"
-}
-
-is_running() {
-    [ -f "$pid_file" ] && ps `get_pid` > /dev/null 2>&1
-}
-
-case "$1" in
-    start)
-    if is_running; then
-        echo "Already started"
-    else
-        echo "Starting $name"
-        cd "$dir"
-        if [ -z "$user" ]; then
-            sudo $cmd >> "$stdout_log" 2>> "$stderr_log" &
-        else
-            sudo -u "$user" $cmd >> "$stdout_log" 2>> "$stderr_log" &
-        fi
-        echo $! > "$pid_file"
-        if ! is_running; then
-            echo "Unable to start, see $stdout_log and $stderr_log"
-            exit 1
-        fi
-    fi
-    ;;
-    stop)
-    if is_running; then
-        echo -n "Stopping $name.."
-        kill `get_pid`
-        for i in {1..10}
-        do
-            if ! is_running; then
-                break
-            fi
-
-            echo -n "."
-            sleep 1
-        done
-        echo
-
-        if is_running; then
-            echo "Not stopped; may still be shutting down or shutdown may have failed"
-            exit 1
-        else
-            echo "Stopped"
-            if [ -f "$pid_file" ]; then
-                rm "$pid_file"
-            fi
-        fi
-    else
-        echo "Not running"
-    fi
-    ;;
-    restart)
-    $0 stop
-    if is_running; then
-        echo "Unable to stop, will not attempt to start"
-        exit 1
-    fi
-    $0 start
-    ;;
-    status)
-    if is_running; then
-        echo "Running"
-    else
-        echo "Stopped"
-        exit 1
-    fi
-    ;;
-    *)
-    echo "Usage: $0 {start|stop|restart|status}"
-    exit 1
-    ;;
-esac
-
-exit 0
index 24e9537..ffe4d14 100644 (file)
@@ -26,45 +26,18 @@ then
        cp /home/ubuntu/.ssh/authorized_keys /root/.ssh
 fi
 
-# Set private IP in /etc/network/interfaces manually in the presence of public interface
-# Some VM images don't add the private interface automatically, we have to do it during the component installation
-if [[ $CLOUD_ENV == "openstack_nofloat" ]]
-then
-       LOCAL_IP=$(cat /opt/config/local_ip_addr.txt)
-       CIDR=$(cat /opt/config/oam_network_cidr.txt)
-       BITMASK=$(echo $CIDR | cut -d"/" -f2)
-
-       # Compute the netmask based on the network cidr
-       if [[ $BITMASK == "8" ]]
-       then
-               NETMASK=255.0.0.0
-       elif [[ $BITMASK == "16" ]]
-       then
-               NETMASK=255.255.0.0
-       elif [[ $BITMASK == "24" ]]
-       then
-               NETMASK=255.255.255.0
-       fi
-
-       echo "auto eth1" >> /etc/network/interfaces
-       echo "iface eth1 inet static" >> /etc/network/interfaces
-       echo "    address $LOCAL_IP" >> /etc/network/interfaces
-       echo "    netmask $NETMASK" >> /etc/network/interfaces
-       echo "    mtu $MTU" >> /etc/network/interfaces
-       ifup eth1
-fi
-
 # Download dependencies
 apt-get update
 apt-get install -y apt-transport-https ca-certificates wget git ntp ntpdate make
 
 # Download scripts from Nexus
 unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip clamp_vm_init.sh > /opt/clamp_vm_init.sh
-unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip clamp_serv.sh > /opt/clamp_serv.sh
+unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip serv.sh > /opt/clamp_serv.sh
 unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip imagetest.sh > /opt/imagetest.sh
 chmod +x /opt/imagetest.sh
 chmod +x /opt/clamp_vm_init.sh
 chmod +x /opt/clamp_serv.sh
+sed -i "s|cmd=\"\"|cmd=\"./clamp_vm_init.sh\"|g" /opt/clamp_serv.sh
 mv /opt/clamp_serv.sh /etc/init.d
 update-rc.d clamp_serv.sh defaults
 
@@ -103,21 +76,7 @@ service docker restart
 echo "nameserver "$DNS_IP_ADDR >> /etc/resolvconf/resolv.conf.d/head
 resolvconf -u
 
-# Clone Gerrit repository
+# Clone Gerrit repository and run docker containers
 cd /opt
 git clone -b $GERRIT_BRANCH --single-branch $CODE_REPO
-
-# Rename network interface in openstack Ubuntu 16.04 images. Then, reboot the VM to pick up changes
-if [[ $CLOUD_ENV != "rackspace" ]]
-then
-       sed -i "s/GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX=\"net.ifnames=0 biosdevname=0\"/g" /etc/default/grub
-       grub-mkconfig -o /boot/grub/grub.cfg
-       sed -i "s/ens[0-9]*/eth0/g" /etc/network/interfaces.d/*.cfg
-       sed -i "s/ens[0-9]*/eth0/g" /etc/udev/rules.d/70-persistent-net.rules
-       echo 'network: {config: disabled}' >> /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
-       echo "APT::Periodic::Unattended-Upgrade \"0\";" >> /etc/apt/apt.conf.d/10periodic
-       reboot
-fi
-
-# Run docker containers. For openstack Ubuntu 16.04 images this will run as a service after the VM has restarted
 ./clamp_vm_init.sh
diff --git a/boot/clamp_serv.sh b/boot/clamp_serv.sh
deleted file mode 100644 (file)
index 2c3a898..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-#!/bin/sh
-### BEGIN INIT INFO
-# Provides:
-# Required-Start:    $remote_fs $syslog
-# Required-Stop:     $remote_fs $syslog
-# Default-Start:     2 3 4 5
-# Default-Stop:      0 1 6
-# Short-Description: Start daemon at boot time
-# Description:       Enable service provided by daemon.
-### END INIT INFO
-HTTP_PROXY=$(cat /opt/config/http_proxy.txt)
-HTTPS_PROXY=$(cat /opt/config/https_proxy.txt)
-
-if [ $HTTP_PROXY != "no_proxy" ]
-then
-    export http_proxy=$HTTP_PROXY
-    export https_proxy=$HTTPS_PROXY
-fi
-
-dir="/opt"
-cmd="./clamp_vm_init.sh"
-user="root"
-
-name=`basename $0`
-pid_file="/var/run/$name.pid"
-stdout_log="/var/log/$name.log"
-stderr_log="/var/log/$name.err"
-
-get_pid() {
-    cat "$pid_file"
-}
-
-is_running() {
-    [ -f "$pid_file" ] && ps `get_pid` > /dev/null 2>&1
-}
-
-case "$1" in
-    start)
-    if is_running; then
-        echo "Already started"
-    else
-        echo "Starting $name"
-        cd "$dir"
-        if [ -z "$user" ]; then
-            sudo $cmd >> "$stdout_log" 2>> "$stderr_log" &
-        else
-            sudo -u "$user" $cmd >> "$stdout_log" 2>> "$stderr_log" &
-        fi
-        echo $! > "$pid_file"
-        if ! is_running; then
-            echo "Unable to start, see $stdout_log and $stderr_log"
-            exit 1
-        fi
-    fi
-    ;;
-    stop)
-    if is_running; then
-        echo -n "Stopping $name.."
-        kill `get_pid`
-        for i in {1..10}
-        do
-            if ! is_running; then
-                break
-            fi
-
-            echo -n "."
-            sleep 1
-        done
-        echo
-
-        if is_running; then
-            echo "Not stopped; may still be shutting down or shutdown may have failed"
-            exit 1
-        else
-            echo "Stopped"
-            if [ -f "$pid_file" ]; then
-                rm "$pid_file"
-            fi
-        fi
-    else
-        echo "Not running"
-    fi
-    ;;
-    restart)
-    $0 stop
-    if is_running; then
-        echo "Unable to stop, will not attempt to start"
-        exit 1
-    fi
-    $0 start
-    ;;
-    status)
-    if is_running; then
-        echo "Running"
-    else
-        echo "Stopped"
-        exit 1
-    fi
-    ;;
-    *)
-    echo "Usage: $0 {start|stop|restart|status}"
-    exit 1
-    ;;
-esac
-
-exit 0
index fe1f431..2bb5a33 100644 (file)
@@ -111,6 +111,7 @@ dcae.api.simpledemo.onap.org.       IN      CNAME   vm1.dcae.simpledemo.onap.org.
 
 ;MSO
 mso.api.simpledemo.onap.org.   IN      CNAME   vm1.mso.simpledemo.onap.org.
+so.api.simpledemo.onap.org.        IN  CNAME   vm1.mso.simpledemo.onap.org.
 
 ;Policy
 policy.api.simpledemo.onap.org.        IN      CNAME   vm1.policy.simpledemo.onap.org.
index e3fa1f6..23409d1 100644 (file)
@@ -110,6 +110,7 @@ dcae.api.simpledemo.openecomp.org.  IN      CNAME   vm1.dcae.simpledemo.openecomp.org.
 
 ;MSO
 mso.api.simpledemo.openecomp.org.      IN      CNAME   vm1.mso.simpledemo.openecomp.org.
+so.api.simpledemo.openecomp.org.       IN      CNAME   vm1.mso.simpledemo.openecomp.org.
 
 ;Policy
 policy.api.simpledemo.openecomp.org.   IN      CNAME   vm1.policy.simpledemo.openecomp.org.
index 6446efa..d0f5fd6 100755 (executable)
@@ -52,11 +52,12 @@ apt-get install -y apt-transport-https ca-certificates wget git ntp ntpdate pyth
 
 # Download scripts from Nexus
 unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip dcae2_vm_init.sh > /opt/dcae2_vm_init.sh
-unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip dcae2_serv.sh > /opt/dcae2_serv.sh
+unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip serv.sh > /opt/dcae2_serv.sh
 unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip imagetest.sh > /opt/imagetest.sh
 chmod +x /opt/imagetest.sh
 chmod +x /opt/dcae2_vm_init.sh
 chmod +x /opt/dcae2_serv.sh
+sed -i "s|cmd=\"\"|cmd=\"./dcae2_vm_init.sh\"|g" /opt/dcae2_serv.sh
 mv /opt/dcae2_serv.sh /etc/init.d
 update-rc.d dcae2_serv.sh defaults
 
@@ -70,7 +71,6 @@ mkdir -p /opt/docker
 curl -L "https://github.com/docker/compose/releases/download/1.9.0/docker-compose-$(uname -s)-$(uname -m)" > /opt/docker/docker-compose
 chmod +x /opt/docker/docker-compose
 
-
 # Set the MTU size of docker containers to the minimum MTU size supported by vNICs. OpenStack deployments may 
 # need to know the external DNS IP
 DNS_FLAG=""
@@ -103,19 +103,13 @@ echo "$(cat /opt/config/dcae_ip_addr.txt) dockerhost" >>/etc/hosts
 echo "nameserver $DNS_IP_ADDR" >> /etc/resolvconf/resolv.conf.d/head
 resolvconf -u
 
-
 # prepare the configurations needed by DCAEGEN2 installer
 rm -rf /opt/app/config
 mkdir -p /opt/app/config
 
-
 # private key
 sed -e 's/\\n/\n/g' /opt/config/priv_key | sed -e 's/^[ \t]*//g; s/[ \t]*$//g' > /opt/app/config/key
 chmod 777 /opt/app/config/key
 
-# move keystone url file
-#cp /opt/config/keystone_url.txt /opt/app/config/keystone_url.txt
-
-
 cd /opt
 ./dcae2_vm_init.sh
diff --git a/boot/dcae2_serv.sh b/boot/dcae2_serv.sh
deleted file mode 100644 (file)
index cfb77e4..0000000
+++ /dev/null
@@ -1,129 +0,0 @@
-#!/bin/sh
-#############################################################################
-#
-# Copyright (c) 2017 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.
-# You may obtain a copy of the License at
-#        http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-#############################################################################
-
-### BEGIN INIT INFO
-# Provides: dcaegen2-bootstrap
-# Required-Start: $remote_fs $syslog
-# Required-Stop: $remote_fs $syslog
-# Default-Start: 2 3 4 5
-# Default-Stop: 0 1 6
-# Short-Description: Start daemon at boot time
-# Description: Enable service provided by daemon.
-### END INIT INFO
-HTTP_PROXY=$(cat /opt/config/http_proxy.txt)
-HTTPS_PROXY=$(cat /opt/config/https_proxy.txt)
-
-if [ $HTTP_PROXY != "no_proxy" ]
-then
-    export http_proxy=$HTTP_PROXY
-    export https_proxy=$HTTPS_PROXY
-fi
-
-dir="/opt"
-cmd="./dcae2_vm_init.sh"
-user="root"
-
-name=$(basename "$0")
-pid_file="/var/run/$name.pid"
-stdout_log="/var/log/$name.log"
-stderr_log="/var/log/$name.err"
-
-get_pid() {
-    cat "$pid_file"
-}
-
-is_running() {
-    CID="$(docker ps | grep 'org.onap.dcaegen2.deployments.bootstrap')"
-    [ ! -z "$CID" ]
-}
-
-case "$1" in
-    start)
-    if is_running; then
-        echo "Already started"
-    else
-        echo "Starting $name"
-        cd "$dir"
-        if [ -z "$user" ]; then
-            sudo $cmd >> "$stdout_log" 2>> "$stderr_log" &
-        else
-            sudo -u "$user" $cmd >> "$stdout_log" 2>> "$stderr_log" &
-        fi
-        echo $! > "$pid_file"
-        if ! is_running; then
-            echo "Unable to start, see $stdout_log and $stderr_log"
-            exit 1
-        fi
-    fi
-    ;;
-    stop)
-    if is_running; then
-        echo -n "Stopping $name.."
-        kill "$(get_pid)"
-        CID=$(docker ps | grep 'nginx' | awk '{ print $1 }')
-        sudo docker stop "$CID"
-
-        CID=$(docker ps | grep 'org.onap.dcaegen2.deployments.bootstrap' | awk '{ print $1 }')
-        docker exec -it "$CID" ./teardown.sh
-        for i in {1..10}
-        do
-            if ! is_running; then
-                break
-            fi
-
-            echo -n "."
-            sleep 1
-        done
-        echo
-
-        if is_running; then
-            echo "Not stopped; may still be shutting down or shutdown may have failed"
-            exit 1
-        else
-            echo "Stopped"
-            if [ -f "$pid_file" ]; then
-                rm "$pid_file"
-            fi
-        fi
-    else
-        echo "Not running"
-    fi
-    ;;
-    restart)
-    $0 stop
-    if is_running; then
-        echo "Unable to stop, will not attempt to start"
-        exit 1
-    fi
-    $0 start
-    ;;
-    status)
-    if is_running; then
-        echo "Running"
-    else
-        echo "Stopped"
-        exit 1
-    fi
-    ;;
-    *)
-    echo "Usage: $0 {start|stop|restart|status}"
-    exit 1
-    ;;
-esac
-
-exit 0
index 55b2495..1f940ac 100644 (file)
@@ -32,33 +32,6 @@ else
        OPTIONS_FILE="named.conf.options"
 fi
 
-# Set private IP in /etc/network/interfaces manually in the presence of public interface
-# Some VM images don't add the private interface automatically, we have to do it during the component installation
-if [[ $CLOUD_ENV == "openstack_nofloat" ]]
-then
-       LOCAL_IP=$(cat /opt/config/dns_ip_addr.txt)
-       CIDR=$(cat /opt/config/oam_network_cidr.txt)
-       BITMASK=$(echo $CIDR | cut -d"/" -f2)
-
-       # Compute the netmask based on the network cidr
-       if [[ $BITMASK == "8" ]]
-       then
-               NETMASK=255.0.0.0
-       elif [[ $BITMASK == "16" ]]
-       then
-               NETMASK=255.255.0.0
-       elif [[ $BITMASK == "24" ]]
-       then
-               NETMASK=255.255.255.0
-       fi
-
-       echo "auto eth1" >> /etc/network/interfaces
-       echo "iface eth1 inet static" >> /etc/network/interfaces
-       echo "    address $LOCAL_IP" >> /etc/network/interfaces
-       echo "    netmask $NETMASK" >> /etc/network/interfaces
-       ifup eth1
-fi
-
 # Download dependencies
 apt-get update
 apt-get install -y apt-transport-https ca-certificates wget bind9 bind9utils bind9-doc ntp ntpdate make
@@ -70,12 +43,10 @@ unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip $ZONE_ONAP > /etc/bind/zones/db.sim
 unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip $OPTIONS_FILE > /etc/bind/named.conf.options
 unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip named.conf.local > /etc/bind/named.conf.local
 
-
-
 # Set the private IP address of each ONAP VM in the Bind configuration in OpenStack deployments
 if [[ $CLOUD_ENV != "rackspace" ]]
 then
-        sed -i "s/dns_forwarder/"$(cat /opt/config/dns_forwarder.txt)"/g" /etc/bind/named.conf.options
+    sed -i "s/dns_forwarder/"$(cat /opt/config/dns_forwarder.txt)"/g" /etc/bind/named.conf.options
        sed -i "s/dns_ip_addr/"$(cat /opt/config/dns_ip_addr.txt)"/g" /etc/bind/named.conf.options
        sed -i "s/external_dns/"$(cat /opt/config/external_dns.txt)"/g" /etc/bind/named.conf.options
        sed -i "s/aai1_ip_addr/"$(cat /opt/config/aai1_ip_addr.txt)"/g" /etc/bind/zones/db.simpledemo.openecomp.org
diff --git a/boot/docker_key.txt b/boot/docker_key.txt
deleted file mode 100644 (file)
index 9290b7c..0000000
+++ /dev/null
@@ -1 +0,0 @@
-58118E89F3A912897C070ADBF76221572C52609D
index 152e67f..b757358 100644 (file)
@@ -26,34 +26,6 @@ then
        cp /home/ubuntu/.ssh/authorized_keys /root/.ssh
 fi
 
-# Set private IP in /etc/network/interfaces manually in the presence of public interface
-# Some VM images don't add the private interface automatically, we have to do it during the component installation
-if [[ $CLOUD_ENV == "openstack_nofloat" ]]
-then
-       LOCAL_IP=$(cat /opt/config/local_ip_addr.txt)
-       CIDR=$(cat /opt/config/oam_network_cidr.txt)
-       BITMASK=$(echo $CIDR | cut -d"/" -f2)
-
-       # Compute the netmask based on the network cidr
-       if [[ $BITMASK == "8" ]]
-       then
-               NETMASK=255.0.0.0
-       elif [[ $BITMASK == "16" ]]
-       then
-               NETMASK=255.255.0.0
-       elif [[ $BITMASK == "24" ]]
-       then
-               NETMASK=255.255.255.0
-       fi
-
-       echo "auto eth1" >> /etc/network/interfaces
-       echo "iface eth1 inet static" >> /etc/network/interfaces
-       echo "    address $LOCAL_IP" >> /etc/network/interfaces
-       echo "    netmask $NETMASK" >> /etc/network/interfaces
-       echo "    mtu $MTU" >> /etc/network/interfaces
-       ifup eth1
-fi
-
 # Download dependencies
 apt-get update
 apt-get install -y apt-transport-https ca-certificates wget make git ntp ntpdate
@@ -61,11 +33,12 @@ apt-get install -y apt-transport-https ca-certificates wget make git ntp ntpdate
 # Download scripts from Nexus
 # a) scripts for message router (mr)
 unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip mr_vm_init.sh > /opt/mr_vm_init.sh
-unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip mr_serv.sh > /opt/mr_serv.sh
+unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip serv.sh > /opt/mr_serv.sh
 unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip imagetest.sh > /opt/imagetest.sh
 chmod +x /opt/imagetest.sh
 chmod +x /opt/mr_vm_init.sh
 chmod +x /opt/mr_serv.sh
+sed -i "s|cmd=\"\"|cmd=\"./mr_vm_init.sh\"|g" /opt/mr_serv.sh
 mv /opt/mr_serv.sh /etc/init.d
 update-rc.d mr_serv.sh defaults
 
diff --git a/boot/mr_serv.sh b/boot/mr_serv.sh
deleted file mode 100644 (file)
index 9e324dc..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-
-#############################################################################
-#
-# Copyright Â© 2017 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.
-# You may obtain a copy of the License at
-#        http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-#############################################################################
-
-#!/bin/sh
-### BEGIN INIT INFO
-# Provides:
-# Required-Start:    $remote_fs $syslog
-# Required-Stop:     $remote_fs $syslog
-# Default-Start:     2 3 4 5
-# Default-Stop:      0 1 6
-# Short-Description: Start daemon at boot time
-# Description:       Enable service provided by daemon.
-### END INIT INFO
-HTTP_PROXY=$(cat /opt/config/http_proxy.txt)
-HTTPS_PROXY=$(cat /opt/config/https_proxy.txt)
-
-if [ $HTTP_PROXY != "no_proxy" ]
-then
-    export http_proxy=$HTTP_PROXY
-    export https_proxy=$HTTPS_PROXY
-fi
-
-dir="/opt"
-cmd="./mr_vm_init.sh"
-user="root"
-
-name=`basename $0`
-pid_file="/var/run/$name.pid"
-stdout_log="/var/log/$name.log"
-stderr_log="/var/log/$name.err"
-
-get_pid() {
-    cat "$pid_file"
-}
-
-is_running() {
-    [ -f "$pid_file" ] && ps `get_pid` > /dev/null 2>&1
-}
-
-case "$1" in
-    start)
-    if is_running; then
-        echo "Already started"
-    else
-        echo "Starting $name"
-        cd "$dir"
-        if [ -z "$user" ]; then
-            sudo $cmd >> "$stdout_log" 2>> "$stderr_log" &
-        else
-            sudo -u "$user" $cmd >> "$stdout_log" 2>> "$stderr_log" &
-        fi
-        echo $! > "$pid_file"
-        if ! is_running; then
-            echo "Unable to start, see $stdout_log and $stderr_log"
-            exit 1
-        fi
-    fi
-    ;;
-    stop)
-    if is_running; then
-        echo -n "Stopping $name.."
-        kill `get_pid`
-        for i in {1..10}
-        do
-            if ! is_running; then
-                break
-            fi
-
-            echo -n "."
-            sleep 1
-        done
-        echo
-
-        if is_running; then
-            echo "Not stopped; may still be shutting down or shutdown may have failed"
-            exit 1
-        else
-            echo "Stopped"
-            if [ -f "$pid_file" ]; then
-                rm "$pid_file"
-            fi
-        fi
-    else
-        echo "Not running"
-    fi
-    ;;
-    restart)
-    $0 stop
-    if is_running; then
-        echo "Unable to stop, will not attempt to start"
-        exit 1
-    fi
-    $0 start
-    ;;
-    status)
-    if is_running; then
-        echo "Running"
-    else
-        echo "Stopped"
-        exit 1
-    fi
-    ;;
-    *)
-    echo "Usage: $0 {start|stop|restart|status}"
-    exit 1
-    ;;
-esac
-
-exit 0
index f01e355..84ba562 100644 (file)
@@ -26,45 +26,18 @@ then
        cp /home/ubuntu/.ssh/authorized_keys /root/.ssh
 fi
 
-# Set private IP in /etc/network/interfaces manually in the presence of public interface
-# Some VM images don't add the private interface automatically, we have to do it during the component installation
-if [[ $CLOUD_ENV == "openstack_nofloat" ]]
-then
-       LOCAL_IP=$(cat /opt/config/local_ip_addr.txt)
-       CIDR=$(cat /opt/config/oam_network_cidr.txt)
-       BITMASK=$(echo $CIDR | cut -d"/" -f2)
-
-       # Compute the netmask based on the network cidr
-       if [[ $BITMASK == "8" ]]
-       then
-               NETMASK=255.0.0.0
-       elif [[ $BITMASK == "16" ]]
-       then
-               NETMASK=255.255.0.0
-       elif [[ $BITMASK == "24" ]]
-       then
-               NETMASK=255.255.255.0
-       fi
-
-       echo "auto eth1" >> /etc/network/interfaces
-       echo "iface eth1 inet static" >> /etc/network/interfaces
-       echo "    address $LOCAL_IP" >> /etc/network/interfaces
-       echo "    netmask $NETMASK" >> /etc/network/interfaces
-       echo "    mtu $MTU" >> /etc/network/interfaces
-       ifup eth1
-fi
-
 # Download dependencies
 apt-get update
 apt-get install -y apt-transport-https ca-certificates wget git ntp ntpdate make
 
 # Download scripts from Nexus
 unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip music_vm_init.sh > /opt/music_vm_init.sh
-unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip music_serv.sh > /opt/music_serv.sh
+unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip serv.sh > /opt/music_serv.sh
 unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip imagetest.sh > /opt/imagetest.sh
 chmod +x /opt/imagetest.sh
 chmod +x /opt/music_vm_init.sh
 chmod +x /opt/music_serv.sh
+sed -i "s|cmd=\"\"|cmd=\"./music_vm_init.sh\"|g" /opt/music_serv.sh
 mv /opt/music_serv.sh /etc/init.d
 update-rc.d music_serv.sh defaults
 
diff --git a/boot/music_serv.sh b/boot/music_serv.sh
deleted file mode 100644 (file)
index 11b95a1..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-#!/bin/sh
-### BEGIN INIT INFO
-# Provides:
-# Required-Start:    $remote_fs $syslog
-# Required-Stop:     $remote_fs $syslog
-# Default-Start:     2 3 4 5
-# Default-Stop:      0 1 6
-# Short-Description: Start daemon at boot time
-# Description:       Enable service provided by daemon.
-### END INIT INFO
-HTTP_PROXY=$(cat /opt/config/http_proxy.txt)
-HTTPS_PROXY=$(cat /opt/config/https_proxy.txt)
-
-if [ $HTTP_PROXY != "no_proxy" ]
-then
-    export http_proxy=$HTTP_PROXY
-    export https_proxy=$HTTPS_PROXY
-fi
-
-dir="/opt"
-cmd="./music_vm_init.sh"
-user="root"
-
-name=`basename $0`
-pid_file="/var/run/$name.pid"
-stdout_log="/var/log/$name.log"
-stderr_log="/var/log/$name.err"
-
-get_pid() {
-    cat "$pid_file"
-}
-
-is_running() {
-    [ -f "$pid_file" ] && ps `get_pid` > /dev/null 2>&1
-}
-
-case "$1" in
-    start)
-    if is_running; then
-        echo "Already started"
-    else
-        echo "Starting $name"
-        cd "$dir"
-        if [ -z "$user" ]; then
-            sudo $cmd >> "$stdout_log" 2>> "$stderr_log" &
-        else
-            sudo -u "$user" $cmd >> "$stdout_log" 2>> "$stderr_log" &
-        fi
-        echo $! > "$pid_file"
-        if ! is_running; then
-            echo "Unable to start, see $stdout_log and $stderr_log"
-            exit 1
-        fi
-    fi
-    ;;
-    stop)
-    if is_running; then
-        echo -n "Stopping $name.."
-        kill `get_pid`
-        for i in {1..10}
-        do
-            if ! is_running; then
-                break
-            fi
-
-            echo -n "."
-            sleep 1
-        done
-        echo
-
-        if is_running; then
-            echo "Not stopped; may still be shutting down or shutdown may have failed"
-            exit 1
-        else
-            echo "Stopped"
-            if [ -f "$pid_file" ]; then
-                rm "$pid_file"
-            fi
-        fi
-    else
-        echo "Not running"
-    fi
-    ;;
-    restart)
-    $0 stop
-    if is_running; then
-        echo "Unable to stop, will not attempt to start"
-        exit 1
-    fi
-    $0 start
-    ;;
-    status)
-    if is_running; then
-        echo "Running"
-    else
-        echo "Stopped"
-        exit 1
-    fi
-    ;;
-    *)
-    echo "Usage: $0 {start|stop|restart|status}"
-    exit 1
-    ;;
-esac
-
-exit 0
index e05b111..7705a25 100644 (file)
@@ -26,44 +26,17 @@ then
        cp /home/ubuntu/.ssh/authorized_keys /root/.ssh
 fi
 
-# Set private IP in /etc/network/interfaces manually in the presence of public interface
-# Some VM images don't add the private interface automatically, we have to do it during the component installation
-if [[ $CLOUD_ENV == "openstack_nofloat" ]]
-then
-       LOCAL_IP=$(cat /opt/config/local_ip_addr.txt)
-       CIDR=$(cat /opt/config/oam_network_cidr.txt)
-       BITMASK=$(echo $CIDR | cut -d"/" -f2)
-
-       # Compute the netmask based on the network cidr
-       if [[ $BITMASK == "8" ]]
-       then
-               NETMASK=255.0.0.0
-       elif [[ $BITMASK == "16" ]]
-       then
-               NETMASK=255.255.0.0
-       elif [[ $BITMASK == "24" ]]
-       then
-               NETMASK=255.255.255.0
-       fi
-
-       echo "auto eth1" >> /etc/network/interfaces
-       echo "iface eth1 inet static" >> /etc/network/interfaces
-       echo "    address $LOCAL_IP" >> /etc/network/interfaces
-       echo "    netmask $NETMASK" >> /etc/network/interfaces
-       echo "    mtu $MTU" >> /etc/network/interfaces
-       ifup eth1
-fi
-
 apt-get update
 apt-get install -y apt-transport-https ca-certificates curl git ntp ntpdate make software-properties-common
 
 # Download scripts from Nexus
 unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip nbi_vm_init.sh > /opt/nbi_vm_init.sh
-unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip nbi_serv.sh > /opt/nbi_serv.sh
+unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip serv.sh > /opt/nbi_serv.sh
 unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip imagetest.sh > /opt/imagetest.sh
 chmod +x /opt/imagetest.sh
 chmod +x /opt/nbi_vm_init.sh
 chmod +x /opt/nbi_serv.sh
+sed -i "s|cmd=\"\"|cmd=\"./nbi_vm_init.sh\"|g" /opt/nbi_serv.sh
 mv /opt/nbi_serv.sh /etc/init.d
 update-rc.d nbi_serv.sh defaults
 
@@ -105,18 +78,6 @@ service docker restart
 echo "nameserver "$DNS_IP_ADDR >> /etc/resolvconf/resolv.conf.d/head
 resolvconf -u
 
-# Rename network interface in openstack Ubuntu 16.04 images. Then, reboot the VM to pick up changes
-if [[ $CLOUD_ENV != "rackspace" ]]
-then
-       sed -i "s/GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX=\"net.ifnames=0 biosdevname=0\"/g" /etc/default/grub
-       grub-mkconfig -o /boot/grub/grub.cfg
-       sed -i "s/ens[0-9]*/eth0/g" /etc/network/interfaces.d/*.cfg
-       sed -i "s/ens[0-9]*/eth0/g" /etc/udev/rules.d/70-persistent-net.rules
-       echo 'network: {config: disabled}' >> /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
-       echo "APT::Periodic::Unattended-Upgrade \"0\";" >> /etc/apt/apt.conf.d/10periodic
-       reboot
-fi
-
 # Run docker containers
 cd /opt
 ./nbi_vm_init.sh
diff --git a/boot/nbi_serv.sh b/boot/nbi_serv.sh
deleted file mode 100644 (file)
index 9c4eea0..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-#!/bin/sh
-### BEGIN INIT INFO
-# Provides:
-# Required-Start:    $remote_fs $syslog
-# Required-Stop:     $remote_fs $syslog
-# Default-Start:     2 3 4 5
-# Default-Stop:      0 1 6
-# Short-Description: Start daemon at boot time
-# Description:       Enable service provided by daemon.
-### END INIT INFO
-HTTP_PROXY=$(cat /opt/config/http_proxy.txt)
-HTTPS_PROXY=$(cat /opt/config/https_proxy.txt)
-
-if [ $HTTP_PROXY != "no_proxy" ]
-then
-    export http_proxy=$HTTP_PROXY
-    export https_proxy=$HTTPS_PROXY
-fi
-
-dir="/opt"
-cmd="./nbi_vm_init.sh"
-user="root"
-
-name=`basename $0`
-pid_file="/var/run/$name.pid"
-stdout_log="/var/log/$name.log"
-stderr_log="/var/log/$name.err"
-
-get_pid() {
-    cat "$pid_file"
-}
-
-is_running() {
-    [ -f "$pid_file" ] && ps `get_pid` > /dev/null 2>&1
-}
-
-case "$1" in
-    start)
-    if is_running; then
-        echo "Already started"
-    else
-        echo "Starting $name"
-        cd "$dir"
-        if [ -z "$user" ]; then
-            sudo $cmd >> "$stdout_log" 2>> "$stderr_log" &
-        else
-            sudo -u "$user" $cmd >> "$stdout_log" 2>> "$stderr_log" &
-        fi
-        echo $! > "$pid_file"
-        if ! is_running; then
-            echo "Unable to start, see $stdout_log and $stderr_log"
-            exit 1
-        fi
-    fi
-    ;;
-    stop)
-    if is_running; then
-        echo -n "Stopping $name.."
-        kill `get_pid`
-        for i in {1..10}
-        do
-            if ! is_running; then
-                break
-            fi
-
-            echo -n "."
-            sleep 1
-        done
-        echo
-
-        if is_running; then
-            echo "Not stopped; may still be shutting down or shutdown may have failed"
-            exit 1
-        else
-            echo "Stopped"
-            if [ -f "$pid_file" ]; then
-                rm "$pid_file"
-            fi
-        fi
-    else
-        echo "Not running"
-    fi
-    ;;
-    restart)
-    $0 stop
-    if is_running; then
-        echo "Unable to stop, will not attempt to start"
-        exit 1
-    fi
-    $0 start
-    ;;
-    status)
-    if is_running; then
-        echo "Running"
-    else
-        echo "Stopped"
-        exit 1
-    fi
-    ;;
-    *)
-    echo "Usage: $0 {start|stop|restart|status}"
-    exit 1
-    ;;
-esac
-
-exit 0
index 338677f..d8eda1d 100644 (file)
@@ -26,45 +26,18 @@ then
        cp /home/ubuntu/.ssh/authorized_keys /root/.ssh
 fi
 
-# Set private IP in /etc/network/interfaces manually in the presence of public interface
-# Some VM images don't add the private interface automatically, we have to do it during the component installation
-if [[ $CLOUD_ENV == "openstack_nofloat" ]]
-then
-       LOCAL_IP=$(cat /opt/config/local_ip_addr.txt)
-       CIDR=$(cat /opt/config/oam_network_cidr.txt)
-       BITMASK=$(echo $CIDR | cut -d"/" -f2)
-
-       # Compute the netmask based on the network cidr
-       if [[ $BITMASK == "8" ]]
-       then
-               NETMASK=255.0.0.0
-       elif [[ $BITMASK == "16" ]]
-       then
-               NETMASK=255.255.0.0
-       elif [[ $BITMASK == "24" ]]
-       then
-               NETMASK=255.255.255.0
-       fi
-
-       echo "auto eth1" >> /etc/network/interfaces
-       echo "iface eth1 inet static" >> /etc/network/interfaces
-       echo "    address $LOCAL_IP" >> /etc/network/interfaces
-       echo "    netmask $NETMASK" >> /etc/network/interfaces
-       echo "    mtu $MTU" >> /etc/network/interfaces
-       ifup eth1
-fi
-
 # Download dependencies
 apt-get update
 apt-get install -y apt-transport-https ca-certificates wget git ntp ntpdate make
 
 # Download scripts from Nexus
 unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip oof_vm_init.sh > /opt/oof_vm_init.sh
-unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip oof_serv.sh > /opt/oof_serv.sh
+unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip serv.sh > /opt/oof_serv.sh
 unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip imagetest.sh > /opt/imagetest.sh
 chmod +x /opt/imagetest.sh
 chmod +x /opt/oof_vm_init.sh
 chmod +x /opt/oof_serv.sh
+sed -i "s|cmd=\"\"|cmd=\"./oof_vm_init.sh\"|g" /opt/oof_serv.sh
 mv /opt/oof_serv.sh /etc/init.d
 update-rc.d oof_serv.sh defaults
 
@@ -103,21 +76,7 @@ service docker restart
 echo "nameserver "$DNS_IP_ADDR >> /etc/resolvconf/resolv.conf.d/head
 resolvconf -u
 
-# Clone Gerrit repository
+# Clone Gerrit repository and run docker containers
 cd /opt
 git clone -b $GERRIT_BRANCH --single-branch $CODE_REPO optf-has
-
-# Rename network interface in openstack Ubuntu 16.04 images. Then, reboot the VM to pick up changes
-if [[ $CLOUD_ENV != "rackspace" ]]
-then
-       sed -i "s/GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX=\"net.ifnames=0 biosdevname=0\"/g" /etc/default/grub
-       grub-mkconfig -o /boot/grub/grub.cfg
-       sed -i "s/ens[0-9]*/eth0/g" /etc/network/interfaces.d/*.cfg
-       sed -i "s/ens[0-9]*/eth0/g" /etc/udev/rules.d/70-persistent-net.rules
-       echo 'network: {config: disabled}' >> /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
-       echo "APT::Periodic::Unattended-Upgrade \"0\";" >> /etc/apt/apt.conf.d/10periodic
-       reboot
-fi
-
-# Run docker containers
 ./oof_vm_init.sh
\ No newline at end of file
diff --git a/boot/oof_serv.sh b/boot/oof_serv.sh
deleted file mode 100644 (file)
index 4e73ac8..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-#!/bin/sh
-### BEGIN INIT INFO
-# Provides:
-# Required-Start:    $remote_fs $syslog
-# Required-Stop:     $remote_fs $syslog
-# Default-Start:     2 3 4 5
-# Default-Stop:      0 1 6
-# Short-Description: Start daemon at boot time
-# Description:       Enable service provided by daemon.
-### END INIT INFO
-HTTP_PROXY=$(cat /opt/config/http_proxy.txt)
-HTTPS_PROXY=$(cat /opt/config/https_proxy.txt)
-
-if [ $HTTP_PROXY != "no_proxy" ]
-then
-    export http_proxy=$HTTP_PROXY
-    export https_proxy=$HTTPS_PROXY
-fi
-
-dir="/opt"
-cmd="./oof_vm_init.sh"
-user="root"
-
-name=`basename $0`
-pid_file="/var/run/$name.pid"
-stdout_log="/var/log/$name.log"
-stderr_log="/var/log/$name.err"
-
-get_pid() {
-    cat "$pid_file"
-}
-
-is_running() {
-    [ -f "$pid_file" ] && ps `get_pid` > /dev/null 2>&1
-}
-
-case "$1" in
-    start)
-    if is_running; then
-        echo "Already started"
-    else
-        echo "Starting $name"
-        cd "$dir"
-        if [ -z "$user" ]; then
-            sudo $cmd >> "$stdout_log" 2>> "$stderr_log" &
-        else
-            sudo -u "$user" $cmd >> "$stdout_log" 2>> "$stderr_log" &
-        fi
-        echo $! > "$pid_file"
-        if ! is_running; then
-            echo "Unable to start, see $stdout_log and $stderr_log"
-            exit 1
-        fi
-    fi
-    ;;
-    stop)
-    if is_running; then
-        echo -n "Stopping $name.."
-        kill `get_pid`
-        for i in {1..10}
-        do
-            if ! is_running; then
-                break
-            fi
-
-            echo -n "."
-            sleep 1
-        done
-        echo
-
-        if is_running; then
-            echo "Not stopped; may still be shutting down or shutdown may have failed"
-            exit 1
-        else
-            echo "Stopped"
-            if [ -f "$pid_file" ]; then
-                rm "$pid_file"
-            fi
-        fi
-    else
-        echo "Not running"
-    fi
-    ;;
-    restart)
-    $0 stop
-    if is_running; then
-        echo "Unable to stop, will not attempt to start"
-        exit 1
-    fi
-    $0 start
-    ;;
-    status)
-    if is_running; then
-        echo "Running"
-    else
-        echo "Stopped"
-        exit 1
-    fi
-    ;;
-    *)
-    echo "Usage: $0 {start|stop|restart|status}"
-    exit 1
-    ;;
-esac
-
-exit 0
index 80c7716..57e0094 100644 (file)
@@ -26,34 +26,6 @@ then
     cp /home/ubuntu/.ssh/authorized_keys /root/.ssh
 fi
 
-# Set private IP in /etc/network/interfaces manually in the presence of public interface
-# Some VM images don't add the private interface automatically, we have to do it during the component installation
-if [[ $CLOUD_ENV == "openstack_nofloat" ]]
-then
-    LOCAL_IP=$(cat /opt/config/local_ip_addr.txt)
-    CIDR=$(cat /opt/config/oam_network_cidr.txt)
-    BITMASK=$(echo $CIDR | cut -d"/" -f2)
-
-    # Compute the netmask based on the network cidr
-    if [[ $BITMASK == "8" ]]
-    then
-        NETMASK=255.0.0.0
-    elif [[ $BITMASK == "16" ]]
-    then
-        NETMASK=255.255.0.0
-    elif [[ $BITMASK == "24" ]]
-    then
-        NETMASK=255.255.255.0
-    fi
-
-    echo "auto eth1" >> /etc/network/interfaces
-    echo "iface eth1 inet static" >> /etc/network/interfaces
-    echo "    address $LOCAL_IP" >> /etc/network/interfaces
-    echo "    netmask $NETMASK" >> /etc/network/interfaces
-    echo "    mtu $MTU" >> /etc/network/interfaces
-    ifup eth1
-fi
-
 # Download dependencies
 apt-get update
 apt-get install -y apt-transport-https ca-certificates wget git unzip mysql-client-core-5.6 ntp ntpdate make
@@ -65,7 +37,7 @@ unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip mvim_vm_init.sh > /opt/mvim_vm_init
 unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip vfc_vm_init.sh > /opt/vfc_vm_init.sh
 unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip uui_vm_init.sh > /opt/uui_vm_init.sh
 unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip openo_all_serv.sh > /opt/openo_all_serv.sh
-unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip openo_serv.sh > /opt/openo_serv.sh
+unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip serv.sh > /opt/openo_serv.sh
 unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip cli_install.sh > /opt/cli_install.sh
 unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip esr_vm_init.sh > /opt/esr_vm_init.sh
 unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip imagetest.sh > /opt/imagetest.sh
@@ -79,6 +51,7 @@ chmod +x /opt/openo_all_serv.sh
 chmod +x /opt/openo_serv.sh
 chmod +x /opt/cli_install.sh
 chmod +x /opt/esr_vm_init.sh
+sed -i "s|cmd=\"\"|cmd=\"./openo_all_serv.sh\"|g" /opt/openo_serv.sh
 mv /opt/openo_serv.sh /etc/init.d
 update-rc.d openo_serv.sh defaults
 
@@ -120,19 +93,5 @@ resolvconf -u
 # Clone Gerrit repository and run docker containers
 cd /opt
 git clone -b $VNFSDK_BRANCH --single-branch $VNFSDK_REPO
-
 source ./cli_install.sh
-
-# Rename network interface in openstack Ubuntu 16.04 images. Then, reboot the VM to pick up changes
-if [[ $CLOUD_ENV != "rackspace" ]]
-then
-    sed -i "s/GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX=\"net.ifnames=0 biosdevname=0\"/g" /etc/default/grub
-    grub-mkconfig -o /boot/grub/grub.cfg
-    sed -i "s/ens[0-9]*/eth0/g" /etc/network/interfaces.d/*.cfg
-    sed -i "s/ens[0-9]*/eth0/g" /etc/udev/rules.d/70-persistent-net.rules
-    echo 'network: {config: disabled}' >> /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
-    echo "APT::Periodic::Unattended-Upgrade \"0\";" >> /etc/apt/apt.conf.d/10periodic
-    reboot
-fi
-
 ./openo_all_serv.sh
\ No newline at end of file
diff --git a/boot/openo_serv.sh b/boot/openo_serv.sh
deleted file mode 100644 (file)
index 71f0245..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-#!/bin/sh
-### BEGIN INIT INFO
-# Provides:
-# Required-Start:    $remote_fs $syslog
-# Required-Stop:     $remote_fs $syslog
-# Default-Start:     2 3 4 5
-# Default-Stop:      0 1 6
-# Short-Description: Start daemon at boot time
-# Description:       Enable service provided by daemon.
-### END INIT INFO
-HTTP_PROXY=$(cat /opt/config/http_proxy.txt)
-HTTPS_PROXY=$(cat /opt/config/https_proxy.txt)
-
-if [ $HTTP_PROXY != "no_proxy" ]
-then
-    export http_proxy=$HTTP_PROXY
-    export https_proxy=$HTTPS_PROXY
-fi
-
-dir="/opt"
-cmd="./openo_all_serv.sh"
-user="root"
-
-name=`basename $0`
-pid_file="/var/run/$name.pid"
-stdout_log="/var/log/$name.log"
-stderr_log="/var/log/$name.err"
-
-get_pid() {
-    cat "$pid_file"
-}
-
-is_running() {
-    [ -f "$pid_file" ] && ps `get_pid` > /dev/null 2>&1
-}
-
-case "$1" in
-    start)
-    if is_running; then
-        echo "Already started"
-    else
-        echo "Starting $name"
-        cd "$dir"
-        if [ -z "$user" ]; then
-            sudo $cmd >> "$stdout_log" 2>> "$stderr_log" &
-        else
-            sudo -u "$user" $cmd >> "$stdout_log" 2>> "$stderr_log" &
-        fi
-        echo $! > "$pid_file"
-        if ! is_running; then
-            echo "Unable to start, see $stdout_log and $stderr_log"
-            exit 1
-        fi
-    fi
-    ;;
-    stop)
-    if is_running; then
-        echo -n "Stopping $name.."
-        kill `get_pid`
-        for i in {1..10}
-        do
-            if ! is_running; then
-                break
-            fi
-
-            echo -n "."
-            sleep 1
-        done
-        echo
-
-        if is_running; then
-            echo "Not stopped; may still be shutting down or shutdown may have failed"
-            exit 1
-        else
-            echo "Stopped"
-            if [ -f "$pid_file" ]; then
-                rm "$pid_file"
-            fi
-        fi
-    else
-        echo "Not running"
-    fi
-    ;;
-    restart)
-    $0 stop
-    if is_running; then
-        echo "Unable to stop, will not attempt to start"
-        exit 1
-    fi
-    $0 start
-    ;;
-    status)
-    if is_running; then
-        echo "Running"
-    else
-        echo "Stopped"
-        exit 1
-    fi
-    ;;
-    *)
-    echo "Usage: $0 {start|stop|restart|status}"
-    exit 1
-    ;;
-esac
-
-exit 0
index cd50487..c77323d 100644 (file)
@@ -26,45 +26,18 @@ then
        cp /home/ubuntu/.ssh/authorized_keys /root/.ssh
 fi
 
-# Set private IP in /etc/network/interfaces manually in the presence of public interface
-# Some VM images don't add the private interface automatically, we have to do it during the component installation
-if [[ $CLOUD_ENV == "openstack_nofloat" ]]
-then
-       LOCAL_IP=$(cat /opt/config/local_ip_addr.txt)
-       CIDR=$(cat /opt/config/oam_network_cidr.txt)
-       BITMASK=$(echo $CIDR | cut -d"/" -f2)
-
-       # Compute the netmask based on the network cidr
-       if [[ $BITMASK == "8" ]]
-       then
-               NETMASK=255.0.0.0
-       elif [[ $BITMASK == "16" ]]
-       then
-               NETMASK=255.255.0.0
-       elif [[ $BITMASK == "24" ]]
-       then
-               NETMASK=255.255.255.0
-       fi
-
-       echo "auto eth1" >> /etc/network/interfaces
-       echo "iface eth1 inet static" >> /etc/network/interfaces
-       echo "    address $LOCAL_IP" >> /etc/network/interfaces
-       echo "    netmask $NETMASK" >> /etc/network/interfaces
-       echo "    mtu $MTU" >> /etc/network/interfaces
-       ifup eth1
-fi
-
 # Download dependencies
 apt-get update
 apt-get install -y apt-transport-https ca-certificates wget git ntp ntpdate make
 
 # Download scripts from Nexus
 unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip policy_vm_init.sh > /opt/policy_vm_init.sh
-unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip policy_serv.sh > /opt/policy_serv.sh
+unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip serv.sh > /opt/policy_serv.sh
 unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip imagetest.sh > /opt/imagetest.sh
 chmod +x /opt/imagetest.sh
 chmod +x /opt/policy_vm_init.sh
 chmod +x /opt/policy_serv.sh
+sed -i "s|cmd=\"\"|cmd=\"./policy_vm_init.sh\"|g" /opt/policy_serv.sh
 mv /opt/policy_serv.sh /etc/init.d
 update-rc.d policy_serv.sh defaults
 
diff --git a/boot/policy_serv.sh b/boot/policy_serv.sh
deleted file mode 100644 (file)
index f5e2b23..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-#!/bin/sh
-### BEGIN INIT INFO
-# Provides:
-# Required-Start:    $remote_fs $syslog
-# Required-Stop:     $remote_fs $syslog
-# Default-Start:     2 3 4 5
-# Default-Stop:      0 1 6
-# Short-Description: Start daemon at boot time
-# Description:       Enable service provided by daemon.
-### END INIT INFO
-HTTP_PROXY=$(cat /opt/config/http_proxy.txt)
-HTTPS_PROXY=$(cat /opt/config/https_proxy.txt)
-
-if [ $HTTP_PROXY != "no_proxy" ]
-then
-    export http_proxy=$HTTP_PROXY
-    export https_proxy=$HTTPS_PROXY
-fi
-
-dir="/opt"
-cmd="./policy_vm_init.sh"
-user="root"
-
-name=`basename $0`
-pid_file="/var/run/$name.pid"
-stdout_log="/var/log/$name.log"
-stderr_log="/var/log/$name.err"
-
-get_pid() {
-    cat "$pid_file"
-}
-
-is_running() {
-    [ -f "$pid_file" ] && ps `get_pid` > /dev/null 2>&1
-}
-
-case "$1" in
-    start)
-    if is_running; then
-        echo "Already started"
-    else
-        echo "Starting $name"
-        cd "$dir"
-        if [ -z "$user" ]; then
-            sudo $cmd >> "$stdout_log" 2>> "$stderr_log" &
-        else
-            sudo -u "$user" $cmd >> "$stdout_log" 2>> "$stderr_log" &
-        fi
-        echo $! > "$pid_file"
-        if ! is_running; then
-            echo "Unable to start, see $stdout_log and $stderr_log"
-            exit 1
-        fi
-    fi
-    ;;
-    stop)
-    if is_running; then
-        echo -n "Stopping $name.."
-        kill `get_pid`
-        for i in {1..10}
-        do
-            if ! is_running; then
-                break
-            fi
-
-            echo -n "."
-            sleep 1
-        done
-        echo
-
-        if is_running; then
-            echo "Not stopped; may still be shutting down or shutdown may have failed"
-            exit 1
-        else
-            echo "Stopped"
-            if [ -f "$pid_file" ]; then
-                rm "$pid_file"
-            fi
-        fi
-    else
-        echo "Not running"
-    fi
-    ;;
-    restart)
-    $0 stop
-    if is_running; then
-        echo "Unable to stop, will not attempt to start"
-        exit 1
-    fi
-    $0 start
-    ;;
-    status)
-    if is_running; then
-        echo "Running"
-    else
-        echo "Stopped"
-        exit 1
-    fi
-    ;;
-    *)
-    echo "Usage: $0 {start|stop|restart|status}"
-    exit 1
-    ;;
-esac
-
-exit 0
index af96e5e..d052d65 100644 (file)
@@ -26,45 +26,18 @@ then
        cp /home/ubuntu/.ssh/authorized_keys /root/.ssh
 fi
 
-# Set private IP in /etc/network/interfaces manually in the presence of public interface
-# Some VM images don't add the private interface automatically, we have to do it during the component installation
-if [[ $CLOUD_ENV == "openstack_nofloat" ]]
-then
-       LOCAL_IP=$(cat /opt/config/local_ip_addr.txt)
-       CIDR=$(cat /opt/config/oam_network_cidr.txt)
-       BITMASK=$(echo $CIDR | cut -d"/" -f2)
-
-       # Compute the netmask based on the network cidr
-       if [[ $BITMASK == "8" ]]
-       then
-               NETMASK=255.0.0.0
-       elif [[ $BITMASK == "16" ]]
-       then
-               NETMASK=255.255.0.0
-       elif [[ $BITMASK == "24" ]]
-       then
-               NETMASK=255.255.255.0
-       fi
-
-       echo "auto eth1" >> /etc/network/interfaces
-       echo "iface eth1 inet static" >> /etc/network/interfaces
-       echo "    address $LOCAL_IP" >> /etc/network/interfaces
-       echo "    netmask $NETMASK" >> /etc/network/interfaces
-       echo "    mtu $MTU" >> /etc/network/interfaces
-       ifup eth1
-fi
-
 # Download dependencies
 apt-get update
 apt-get install -y apt-transport-https ca-certificates wget git unzip mysql-client-core-5.6 ntp ntpdate make
 
 # Download scripts from Nexus
 unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip portal_vm_init.sh > /opt/portal_vm_init.sh
-unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip portal_serv.sh > /opt/portal_serv.sh
+unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip serv.sh > /opt/portal_serv.sh
 unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip imagetest.sh > /opt/imagetest.sh
 chmod +x /opt/imagetest.sh
 chmod +x /opt/portal_vm_init.sh
 chmod +x /opt/portal_serv.sh
+sed -i "s|cmd=\"\"|cmd=\"./portal_vm_init.sh\"|g" /opt/portal_serv.sh
 mv /opt/portal_serv.sh /etc/init.d
 update-rc.d portal_serv.sh defaults
 
@@ -106,5 +79,4 @@ resolvconf -u
 # Clone Gerrit repository and run docker containers
 cd /opt
 git clone -b $GERRIT_BRANCH --single-branch $CODE_REPO
-
 ./portal_vm_init.sh
diff --git a/boot/portal_serv.sh b/boot/portal_serv.sh
deleted file mode 100644 (file)
index d27e469..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-#!/bin/sh
-### BEGIN INIT INFO
-# Provides:
-# Required-Start:    $remote_fs $syslog
-# Required-Stop:     $remote_fs $syslog
-# Default-Start:     2 3 4 5
-# Default-Stop:      0 1 6
-# Short-Description: Start daemon at boot time
-# Description:       Enable service provided by daemon.
-### END INIT INFO
-HTTP_PROXY=$(cat /opt/config/http_proxy.txt)
-HTTPS_PROXY=$(cat /opt/config/https_proxy.txt)
-
-if [ $HTTP_PROXY != "no_proxy" ]
-then
-    export http_proxy=$HTTP_PROXY
-    export https_proxy=$HTTPS_PROXY
-fi
-
-dir="/opt"
-cmd="./portal_vm_init.sh"
-user="root"
-
-name=`basename $0`
-pid_file="/var/run/$name.pid"
-stdout_log="/var/log/$name.log"
-stderr_log="/var/log/$name.err"
-
-get_pid() {
-    cat "$pid_file"
-}
-
-is_running() {
-    [ -f "$pid_file" ] && ps `get_pid` > /dev/null 2>&1
-}
-
-case "$1" in
-    start)
-    if is_running; then
-        echo "Already started"
-    else
-        echo "Starting $name"
-        cd "$dir"
-        if [ -z "$user" ]; then
-            sudo $cmd >> "$stdout_log" 2>> "$stderr_log" &
-        else
-            sudo -u "$user" $cmd >> "$stdout_log" 2>> "$stderr_log" &
-        fi
-        echo $! > "$pid_file"
-        if ! is_running; then
-            echo "Unable to start, see $stdout_log and $stderr_log"
-            exit 1
-        fi
-    fi
-    ;;
-    stop)
-    if is_running; then
-        echo -n "Stopping $name.."
-        kill `get_pid`
-        for i in {1..10}
-        do
-            if ! is_running; then
-                break
-            fi
-
-            echo -n "."
-            sleep 1
-        done
-        echo
-
-        if is_running; then
-            echo "Not stopped; may still be shutting down or shutdown may have failed"
-            exit 1
-        else
-            echo "Stopped"
-            if [ -f "$pid_file" ]; then
-                rm "$pid_file"
-            fi
-        fi
-    else
-        echo "Not running"
-    fi
-    ;;
-    restart)
-    $0 stop
-    if is_running; then
-        echo "Unable to stop, will not attempt to start"
-        exit 1
-    fi
-    $0 start
-    ;;
-    status)
-    if is_running; then
-        echo "Running"
-    else
-        echo "Stopped"
-        exit 1
-    fi
-    ;;
-    *)
-    echo "Usage: $0 {start|stop|restart|status}"
-    exit 1
-    ;;
-esac
-
-exit 0
index a41cf88..7896ecd 100644 (file)
@@ -27,42 +27,15 @@ then
        cp /home/ubuntu/.ssh/authorized_keys /root/.ssh
 fi
 
-# Set private IP in /etc/network/interfaces manually in the presence of public interface
-# Some VM images don't add the private interface automatically, we have to do it during the component installation
-if [[ $CLOUD_ENV == "openstack_nofloat" ]]
-then
-       LOCAL_IP=$(cat /opt/config/local_ip_addr.txt)
-       CIDR=$(cat /opt/config/oam_network_cidr.txt)
-       BITMASK=$(echo $CIDR | cut -d"/" -f2)
-
-       # Compute the netmask based on the network cidr
-       if [[ $BITMASK == "8" ]]
-       then
-               NETMASK=255.0.0.0
-       elif [[ $BITMASK == "16" ]]
-       then
-               NETMASK=255.255.0.0
-       elif [[ $BITMASK == "24" ]]
-       then
-               NETMASK=255.255.255.0
-       fi
-
-       echo "auto eth1" >> /etc/network/interfaces
-       echo "iface eth1 inet static" >> /etc/network/interfaces
-       echo "    address $LOCAL_IP" >> /etc/network/interfaces
-       echo "    netmask $NETMASK" >> /etc/network/interfaces
-       echo "    mtu $MTU" >> /etc/network/interfaces
-       ifup eth1
-fi
-
 apt-get update
 apt-get install -y apt-transport-https ca-certificates wget git ntp ntpdate make
 
 # Download scripts from Nexus
 unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip robot_vm_init.sh > /opt/robot_vm_init.sh
 chmod +x /opt/robot_vm_init.sh
-unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip robot_serv.sh > /opt/robot_serv.sh
+unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip serv.sh > /opt/robot_serv.sh
 chmod +x /opt/robot_serv.sh
+sed -i "s|cmd=\"\"|cmd=\"./robot_vm_init.sh\"|g" /opt/robot_serv.sh
 unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip imagetest.sh > /opt/imagetest.sh
 chmod +x /opt/imagetest.sh
 
@@ -112,18 +85,5 @@ service docker restart
 echo "nameserver "$DNS_IP_ADDR >> /etc/resolvconf/resolv.conf.d/head
 resolvconf -u
 
-
-# Rename network interface in openstack Ubuntu 16.04 images. Then, reboot the VM to pick up changes
-if [[ $CLOUD_ENV != "rackspace" ]]
-then
-       sed -i "s/GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX=\"net.ifnames=0 biosdevname=0\"/g" /etc/default/grub
-       grub-mkconfig -o /boot/grub/grub.cfg
-       sed -i "s/ens[0-9]*/eth0/g" /etc/network/interfaces.d/*.cfg
-       sed -i "s/ens[0-9]*/eth0/g" /etc/udev/rules.d/70-persistent-net.rules
-       echo 'network: {config: disabled}' >> /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
-       echo "APT::Periodic::Unattended-Upgrade \"0\";" >> /etc/apt/apt.conf.d/10periodic
-       reboot
-fi
-
-# Run docker containers. For openstack Ubuntu 16.04 images this will run as a service after the VM has restarted
+# Run docker containers.
 ./robot_vm_init.sh
diff --git a/boot/robot_serv.sh b/boot/robot_serv.sh
deleted file mode 100644 (file)
index 75934f4..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-#!/bin/sh
-### BEGIN INIT INFO
-# Provides:          onap-testsuite
-# Required-Start:    $remote_fs $syslog
-# Required-Stop:     $remote_fs $syslog
-# Default-Start:     2 3 4 5
-# Default-Stop:      0 1 6
-# Short-Description: Start daemon at boot time
-# Description:       Enable service provided by daemon.
-### END INIT INFO
-HTTP_PROXY=$(cat /opt/config/http_proxy.txt)
-HTTPS_PROXY=$(cat /opt/config/https_proxy.txt)
-
-if [ $HTTP_PROXY != "no_proxy" ]
-then
-    export http_proxy=$HTTP_PROXY
-    export https_proxy=$HTTPS_PROXY
-fi
-
-dir="/opt"
-cmd="./robot_vm_init.sh"
-user="root"
-
-name=`basename $0`
-pid_file="/var/run/$name.pid"
-stdout_log="/var/log/$name.log"
-stderr_log="/var/log/$name.err"
-
-get_pid() {
-    cat "$pid_file"
-}
-
-is_running() {
-    [ -f "$pid_file" ] && ps `get_pid` > /dev/null 2>&1
-}
-
-case "$1" in
-    start)
-    if is_running; then
-        echo "Already started"
-    else
-        echo "Starting $name"
-        cd "$dir"
-        if [ -z "$user" ]; then
-            sudo $cmd >> "$stdout_log" 2>> "$stderr_log" &
-        else
-            sudo -u "$user" $cmd >> "$stdout_log" 2>> "$stderr_log" &
-        fi
-        echo $! > "$pid_file"
-        if ! is_running; then
-            echo "Unable to start, see $stdout_log and $stderr_log"
-            exit 1
-        fi
-    fi
-    ;;
-    stop)
-    if is_running; then
-        echo -n "Stopping $name.."
-        kill `get_pid`
-        for i in {1..10}
-        do
-            if ! is_running; then
-                break
-            fi
-
-            echo -n "."
-            sleep 1
-        done
-        echo
-
-        if is_running; then
-            echo "Not stopped; may still be shutting down or shutdown may have failed"
-            exit 1
-        else
-            echo "Stopped"
-            if [ -f "$pid_file" ]; then
-                rm "$pid_file"
-            fi
-        fi
-    else
-        echo "Not running"
-    fi
-    ;;
-    restart)
-    $0 stop
-    if is_running; then
-        echo "Unable to stop, will not attempt to start"
-        exit 1
-    fi
-    $0 start
-    ;;
-    status)
-    if is_running; then
-        echo "Running"
-    else
-        echo "Stopped"
-        exit 1
-    fi
-    ;;
-    *)
-    echo "Usage: $0 {start|stop|restart|status}"
-    exit 1
-    ;;
-esac
-
-exit 0
index fd0ae90..5596373 100644 (file)
@@ -26,45 +26,18 @@ then
        cp /home/ubuntu/.ssh/authorized_keys /root/.ssh
 fi
 
-# Set private IP in /etc/network/interfaces manually in the presence of public interface
-# Some VM images don't add the private interface automatically, we have to do it during the component installation
-if [[ $CLOUD_ENV == "openstack_nofloat" ]]
-then
-       LOCAL_IP=$(cat /opt/config/local_ip_addr.txt)
-       CIDR=$(cat /opt/config/oam_network_cidr.txt)
-       BITMASK=$(echo $CIDR | cut -d"/" -f2)
-
-       # Compute the netmask based on the network cidr
-       if [[ $BITMASK == "8" ]]
-       then
-               NETMASK=255.0.0.0
-       elif [[ $BITMASK == "16" ]]
-       then
-               NETMASK=255.255.0.0
-       elif [[ $BITMASK == "24" ]]
-       then
-               NETMASK=255.255.255.0
-       fi
-
-       echo "auto eth1" >> /etc/network/interfaces
-       echo "iface eth1 inet static" >> /etc/network/interfaces
-       echo "    address $LOCAL_IP" >> /etc/network/interfaces
-       echo "    netmask $NETMASK" >> /etc/network/interfaces
-       echo "    mtu $MTU" >> /etc/network/interfaces
-       ifup eth1
-fi
-
 # Download dependencies
 apt-get update
 apt-get install -y apt-transport-https ca-certificates wget git ntp ntpdate make
 
 # Download scripts from Nexus
 unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip sdc_vm_init.sh > /opt/sdc_vm_init.sh
-unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip sdc_serv.sh > /opt/sdc_serv.sh
+unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip serv.sh > /opt/sdc_serv.sh
 unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip sdc_wfd_vm_init.sh > /opt/sdc_wfd_vm_init.sh
 chmod +x /opt/sdc_vm_init.sh
 chmod +x /opt/sdc_serv.sh
 chmod +x /opt/sdc_wfd_vm_init.sh
+sed -i "s|cmd=\"\"|cmd=\"./sdc_vm_init.sh\"|g" /opt/sdc_serv.sh
 mv /opt/sdc_serv.sh /etc/init.d
 update-rc.d sdc_serv.sh defaults
 
@@ -139,18 +112,6 @@ alias rund='/data/scripts/docker_run.sh'
 alias health='/data/scripts/docker_health.sh'
 EOF
 
-# Rename network interface in openstack Ubuntu 16.04 images. Then, reboot the VM to pick up changes
-if [[ $CLOUD_ENV != "rackspace" ]]
-then
-       sed -i "s/GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX=\"net.ifnames=0 biosdevname=0\"/g" /etc/default/grub
-       grub-mkconfig -o /boot/grub/grub.cfg
-       sed -i "s/ens[0-9]*/eth0/g" /etc/network/interfaces.d/*.cfg
-       sed -i "s/ens[0-9]*/eth0/g" /etc/udev/rules.d/70-persistent-net.rules
-       echo 'network: {config: disabled}' >> /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
-       echo "APT::Periodic::Unattended-Upgrade \"0\";" >> /etc/apt/apt.conf.d/10periodic
-       reboot
-fi
-
 # Run docker containers. For openstack Ubuntu 16.04 images this will run as a service after the VM has restarted
 ./sdc_vm_init.sh
 ./sdc_wfd_vm_init.sh
diff --git a/boot/sdc_serv.sh b/boot/sdc_serv.sh
deleted file mode 100644 (file)
index 8083cb7..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-#!/bin/sh
-### BEGIN INIT INFO
-# Provides:
-# Required-Start:    $remote_fs $syslog
-# Required-Stop:     $remote_fs $syslog
-# Default-Start:     2 3 4 5
-# Default-Stop:      0 1 6
-# Short-Description: Start daemon at boot time
-# Description:       Enable service provided by daemon.
-### END INIT INFO
-HTTP_PROXY=$(cat /opt/config/http_proxy.txt)
-HTTPS_PROXY=$(cat /opt/config/https_proxy.txt)
-
-if [ $HTTP_PROXY != "no_proxy" ]
-then
-    export http_proxy=$HTTP_PROXY
-    export https_proxy=$HTTPS_PROXY
-fi
-
-dir="/opt"
-cmd="./sdc_vm_init.sh"
-user="root"
-
-name=`basename $0`
-pid_file="/var/run/$name.pid"
-stdout_log="/var/log/$name.log"
-stderr_log="/var/log/$name.err"
-
-get_pid() {
-    cat "$pid_file"
-}
-
-is_running() {
-    [ -f "$pid_file" ] && ps `get_pid` > /dev/null 2>&1
-}
-
-case "$1" in
-    start)
-    if is_running; then
-        echo "Already started"
-    else
-        echo "Starting $name"
-        cd "$dir"
-        if [ -z "$user" ]; then
-            sudo $cmd >> "$stdout_log" 2>> "$stderr_log" &
-        else
-            sudo -u "$user" $cmd >> "$stdout_log" 2>> "$stderr_log" &
-        fi
-        echo $! > "$pid_file"
-        if ! is_running; then
-            echo "Unable to start, see $stdout_log and $stderr_log"
-            exit 1
-        fi
-    fi
-    ;;
-    stop)
-    if is_running; then
-        echo -n "Stopping $name.."
-        kill `get_pid`
-        for i in {1..10}
-        do
-            if ! is_running; then
-                break
-            fi
-
-            echo -n "."
-            sleep 1
-        done
-        echo
-
-        if is_running; then
-            echo "Not stopped; may still be shutting down or shutdown may have failed"
-            exit 1
-        else
-            echo "Stopped"
-            if [ -f "$pid_file" ]; then
-                rm "$pid_file"
-            fi
-        fi
-    else
-        echo "Not running"
-    fi
-    ;;
-    restart)
-    $0 stop
-    if is_running; then
-        echo "Unable to stop, will not attempt to start"
-        exit 1
-    fi
-    $0 start
-    ;;
-    status)
-    if is_running; then
-        echo "Running"
-    else
-        echo "Stopped"
-        exit 1
-    fi
-    ;;
-    *)
-    echo "Usage: $0 {start|stop|restart|status}"
-    exit 1
-    ;;
-esac
-
-exit 0
index e7333cd..2c82eea 100644 (file)
@@ -26,45 +26,18 @@ then
        cp /home/ubuntu/.ssh/authorized_keys /root/.ssh
 fi
 
-# Set private IP in /etc/network/interfaces manually in the presence of public interface
-# Some VM images don't add the private interface automatically, we have to do it during the component installation
-if [[ $CLOUD_ENV == "openstack_nofloat" ]]
-then
-       LOCAL_IP=$(cat /opt/config/local_ip_addr.txt)
-       CIDR=$(cat /opt/config/oam_network_cidr.txt)
-       BITMASK=$(echo $CIDR | cut -d"/" -f2)
-
-       # Compute the netmask based on the network cidr
-       if [[ $BITMASK == "8" ]]
-       then
-               NETMASK=255.0.0.0
-       elif [[ $BITMASK == "16" ]]
-       then
-               NETMASK=255.255.0.0
-       elif [[ $BITMASK == "24" ]]
-       then
-               NETMASK=255.255.255.0
-       fi
-
-       echo "auto eth1" >> /etc/network/interfaces
-       echo "iface eth1 inet static" >> /etc/network/interfaces
-       echo "    address $LOCAL_IP" >> /etc/network/interfaces
-       echo "    netmask $NETMASK" >> /etc/network/interfaces
-       echo "    mtu $MTU" >> /etc/network/interfaces
-       ifup eth1
-fi
-
 # Download dependencies
 apt-get update
 apt-get install -y apt-transport-https ca-certificates wget git ntp ntpdate make jq
 
 # Download scripts from Nexus
 unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip sdnc_vm_init.sh > /opt/sdnc_vm_init.sh
-unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip sdnc_serv.sh > /opt/sdnc_serv.sh
+unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip serv.sh > /opt/sdnc_serv.sh
 unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip imagetest.sh > /opt/imagetest.sh
 chmod +x /opt/imagetest.sh
 chmod +x /opt/sdnc_vm_init.sh
 chmod +x /opt/sdnc_serv.sh
+sed -i "s|cmd=\"\"|cmd=\"./sdnc_vm_init.sh\"|g" /opt/sdnc_serv.sh
 mv /opt/sdnc_serv.sh /etc/init.d
 update-rc.d sdnc_serv.sh defaults
 
diff --git a/boot/sdnc_serv.sh b/boot/sdnc_serv.sh
deleted file mode 100644 (file)
index e5bb37e..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-#!/bin/sh
-### BEGIN INIT INFO
-# Provides:
-# Required-Start:    $remote_fs $syslog
-# Required-Stop:     $remote_fs $syslog
-# Default-Start:     2 3 4 5
-# Default-Stop:      0 1 6
-# Short-Description: Start daemon at boot time
-# Description:       Enable service provided by daemon.
-### END INIT INFO
-HTTP_PROXY=$(cat /opt/config/http_proxy.txt)
-HTTPS_PROXY=$(cat /opt/config/https_proxy.txt)
-
-if [ $HTTP_PROXY != "no_proxy" ]
-then
-    export http_proxy=$HTTP_PROXY
-    export https_proxy=$HTTPS_PROXY
-fi
-
-dir="/opt"
-cmd="./sdnc_vm_init.sh"
-user="root"
-
-name=`basename $0`
-pid_file="/var/run/$name.pid"
-stdout_log="/var/log/$name.log"
-stderr_log="/var/log/$name.err"
-
-get_pid() {
-    cat "$pid_file"
-}
-
-is_running() {
-    [ -f "$pid_file" ] && ps `get_pid` > /dev/null 2>&1
-}
-
-case "$1" in
-    start)
-    if is_running; then
-        echo "Already started"
-    else
-        echo "Starting $name"
-        cd "$dir"
-        if [ -z "$user" ]; then
-            sudo $cmd >> "$stdout_log" 2>> "$stderr_log" &
-        else
-            sudo -u "$user" $cmd >> "$stdout_log" 2>> "$stderr_log" &
-        fi
-        echo $! > "$pid_file"
-        if ! is_running; then
-            echo "Unable to start, see $stdout_log and $stderr_log"
-            exit 1
-        fi
-    fi
-    ;;
-    stop)
-    if is_running; then
-        echo -n "Stopping $name.."
-        kill `get_pid`
-        for i in {1..10}
-        do
-            if ! is_running; then
-                break
-            fi
-
-            echo -n "."
-            sleep 1
-        done
-        echo
-
-        if is_running; then
-            echo "Not stopped; may still be shutting down or shutdown may have failed"
-            exit 1
-        else
-            echo "Stopped"
-            if [ -f "$pid_file" ]; then
-                rm "$pid_file"
-            fi
-        fi
-    else
-        echo "Not running"
-    fi
-    ;;
-    restart)
-    $0 stop
-    if is_running; then
-        echo "Unable to stop, will not attempt to start"
-        exit 1
-    fi
-    $0 start
-    ;;
-    status)
-    if is_running; then
-        echo "Running"
-    else
-        echo "Stopped"
-        exit 1
-    fi
-    ;;
-    *)
-    echo "Usage: $0 {start|stop|restart|status}"
-    exit 1
-    ;;
-esac
-
-exit 0
similarity index 99%
rename from boot/so_serv.sh
rename to boot/serv.sh
index 48e7259..d34bd19 100644 (file)
@@ -18,7 +18,7 @@ then
 fi
 
 dir="/opt"
-cmd="./so_vm_init.sh"
+cmd=""
 user="root"
 
 name=`basename $0`
index 9bcf19f..bdd3a63 100644 (file)
@@ -26,45 +26,18 @@ then
        cp /home/ubuntu/.ssh/authorized_keys /root/.ssh
 fi
 
-# Set private IP in /etc/network/interfaces manually in the presence of public interface
-# Some VM images don't add the private interface automatically, we have to do it during the component installation
-if [[ $CLOUD_ENV == "openstack_nofloat" ]]
-then
-       LOCAL_IP=$(cat /opt/config/local_ip_addr.txt)
-       CIDR=$(cat /opt/config/oam_network_cidr.txt)
-       BITMASK=$(echo $CIDR | cut -d"/" -f2)
-
-       # Compute the netmask based on the network cidr
-       if [[ $BITMASK == "8" ]]
-       then
-               NETMASK=255.0.0.0
-       elif [[ $BITMASK == "16" ]]
-       then
-               NETMASK=255.255.0.0
-       elif [[ $BITMASK == "24" ]]
-       then
-               NETMASK=255.255.255.0
-       fi
-
-       echo "auto eth1" >> /etc/network/interfaces
-       echo "iface eth1 inet static" >> /etc/network/interfaces
-       echo "    address $LOCAL_IP" >> /etc/network/interfaces
-       echo "    netmask $NETMASK" >> /etc/network/interfaces
-       echo "    mtu $MTU" >> /etc/network/interfaces
-       ifup eth1
-fi
-
 # Download dependencies
 apt-get update
 apt-get install -y apt-transport-https ca-certificates wget git ntp ntpdate make
 
 # Download scripts from Nexus
 unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip sms_vm_init.sh > /opt/sms_vm_init.sh
-unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip sms_serv.sh > /opt/sms_serv.sh
+unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip serv.sh > /opt/sms_serv.sh
 unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip imagetest.sh > /opt/imagetest.sh
 chmod +x /opt/imagetest.sh
 chmod +x /opt/sms_vm_init.sh
 chmod +x /opt/sms_serv.sh
+sed -i "s|cmd=\"\"|cmd=\"./sms_vm_init.sh\"|g" /opt/sms_serv.sh
 mv /opt/sms_serv.sh /etc/init.d
 update-rc.d sms_serv.sh defaults
 
@@ -106,18 +79,4 @@ resolvconf -u
 # Clone Gerrit repository and run docker containers
 cd /opt
 git clone -b $GERRIT_BRANCH --single-branch $CODE_REPO
-
-# Rename network interface in openstack Ubuntu 16.04 images. Then, reboot the VM to pick up changes
-if [[ $CLOUD_ENV != "rackspace" ]]
-then
-       sed -i "s/GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX=\"net.ifnames=0 biosdevname=0\"/g" /etc/default/grub
-       grub-mkconfig -o /boot/grub/grub.cfg
-       sed -i "s/ens[0-9]*/eth0/g" /etc/network/interfaces.d/*.cfg
-       sed -i "s/ens[0-9]*/eth0/g" /etc/udev/rules.d/70-persistent-net.rules
-       echo 'network: {config: disabled}' >> /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
-       echo "APT::Periodic::Unattended-Upgrade \"0\";" >> /etc/apt/apt.conf.d/10periodic
-       reboot
-fi
-
-# Run docker containers. For openstack Ubuntu 16.04 images this will run as a service after the VM has restarted
 ./sms_vm_init.sh
\ No newline at end of file
diff --git a/boot/sms_serv.sh b/boot/sms_serv.sh
deleted file mode 100644 (file)
index 06310db..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-#!/bin/sh
-### BEGIN INIT INFO
-# Provides:
-# Required-Start:    $remote_fs $syslog
-# Required-Stop:     $remote_fs $syslog
-# Default-Start:     2 3 4 5
-# Default-Stop:      0 1 6
-# Short-Description: Start daemon at boot time
-# Description:       Enable service provided by daemon.
-### END INIT INFO
-HTTP_PROXY=$(cat /opt/config/http_proxy.txt)
-HTTPS_PROXY=$(cat /opt/config/https_proxy.txt)
-
-if [ $HTTP_PROXY != "no_proxy" ]
-then
-    export http_proxy=$HTTP_PROXY
-    export https_proxy=$HTTPS_PROXY
-fi
-
-dir="/opt"
-cmd="./sms_vm_init.sh"
-user="root"
-
-name=`basename $0`
-pid_file="/var/run/$name.pid"
-stdout_log="/var/log/$name.log"
-stderr_log="/var/log/$name.err"
-
-get_pid() {
-    cat "$pid_file"
-}
-
-is_running() {
-    [ -f "$pid_file" ] && ps `get_pid` > /dev/null 2>&1
-}
-
-case "$1" in
-    start)
-    if is_running; then
-        echo "Already started"
-    else
-        echo "Starting $name"
-        cd "$dir"
-        if [ -z "$user" ]; then
-            sudo $cmd >> "$stdout_log" 2>> "$stderr_log" &
-        else
-            sudo -u "$user" $cmd >> "$stdout_log" 2>> "$stderr_log" &
-        fi
-        echo $! > "$pid_file"
-        if ! is_running; then
-            echo "Unable to start, see $stdout_log and $stderr_log"
-            exit 1
-        fi
-    fi
-    ;;
-    stop)
-    if is_running; then
-        echo -n "Stopping $name.."
-        kill `get_pid`
-        for i in {1..10}
-        do
-            if ! is_running; then
-                break
-            fi
-
-            echo -n "."
-            sleep 1
-        done
-        echo
-
-        if is_running; then
-            echo "Not stopped; may still be shutting down or shutdown may have failed"
-            exit 1
-        else
-            echo "Stopped"
-            if [ -f "$pid_file" ]; then
-                rm "$pid_file"
-            fi
-        fi
-    else
-        echo "Not running"
-    fi
-    ;;
-    restart)
-    $0 stop
-    if is_running; then
-        echo "Unable to stop, will not attempt to start"
-        exit 1
-    fi
-    $0 start
-    ;;
-    status)
-    if is_running; then
-        echo "Running"
-    else
-        echo "Stopped"
-        exit 1
-    fi
-    ;;
-    *)
-    echo "Usage: $0 {start|stop|restart|status}"
-    exit 1
-    ;;
-esac
-
-exit 0
index f3700dc..e47a73f 100644 (file)
@@ -27,45 +27,18 @@ then
        cp /home/ubuntu/.ssh/authorized_keys /root/.ssh
 fi
 
-# Set private IP in /etc/network/interfaces manually in the presence of public interface
-# Some VM images don't add the private interface automatically, we have to do it during the component installation
-if [[ $CLOUD_ENV == "openstack_nofloat" ]]
-then
-       LOCAL_IP=$(cat /opt/config/local_ip_addr.txt)
-       CIDR=$(cat /opt/config/oam_network_cidr.txt)
-       BITMASK=$(echo $CIDR | cut -d"/" -f2)
-
-       # Compute the netmask based on the network cidr
-       if [[ $BITMASK == "8" ]]
-       then
-               NETMASK=255.0.0.0
-       elif [[ $BITMASK == "16" ]]
-       then
-               NETMASK=255.255.0.0
-       elif [[ $BITMASK == "24" ]]
-       then
-               NETMASK=255.255.255.0
-       fi
-
-       echo "auto eth1" >> /etc/network/interfaces
-       echo "iface eth1 inet static" >> /etc/network/interfaces
-       echo "    address $LOCAL_IP" >> /etc/network/interfaces
-       echo "    netmask $NETMASK" >> /etc/network/interfaces
-       echo "    mtu $MTU" >> /etc/network/interfaces
-       ifup eth1
-fi
-
 # Download dependencies
 apt-get update
 apt-get install -y apt-transport-https ca-certificates wget git ntp ntpdate make
 
 # Download scripts from Nexus
 unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip so_vm_init.sh > /opt/so_vm_init.sh
-unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip so_serv.sh > /opt/so_serv.sh
+unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip serv.sh > /opt/so_serv.sh
 unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip imagetest.sh > /opt/imagetest.sh
 chmod +x /opt/imagetest.sh
 chmod +x /opt/so_vm_init.sh
 chmod +x /opt/so_serv.sh
+sed -i "s|cmd=\"\"|cmd=\"./so_vm_init.sh\"|g" /opt/so_serv.sh
 mv /opt/so_serv.sh /etc/init.d
 update-rc.d so_serv.sh defaults
 
@@ -104,23 +77,10 @@ service docker restart
 echo "nameserver "$DNS_IP_ADDR >> /etc/resolvconf/resolv.conf.d/head
 resolvconf -u
 
-# Clone Gerrit repository
+# Clone Gerrit repository and run docker containers.
 cd /opt
 git clone -b $GERRIT_BRANCH --single-branch $CODE_REPO test_lab
 SO_ENCRYPTION_KEY=$(cat /opt/test_lab/encryption.key)
 echo -n "$OPENSTACK_API_KEY" | openssl aes-128-ecb -e -K $SO_ENCRYPTION_KEY -nosalt | xxd -c 256 -p > /opt/config/api_key.txt
 
-# Rename network interface in openstack Ubuntu 16.04 images. Then, reboot the VM to pick up changes
-if [[ $CLOUD_ENV != "rackspace" ]]
-then
-       sed -i "s/GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX=\"net.ifnames=0 biosdevname=0\"/g" /etc/default/grub
-       grub-mkconfig -o /boot/grub/grub.cfg
-       sed -i "s/ens[0-9]*/eth0/g" /etc/network/interfaces.d/*.cfg
-       sed -i "s/ens[0-9]*/eth0/g" /etc/udev/rules.d/70-persistent-net.rules
-       echo 'network: {config: disabled}' >> /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg
-       echo "APT::Periodic::Unattended-Upgrade \"0\";" >> /etc/apt/apt.conf.d/10periodic
-       reboot
-fi
-
-# Run docker containers. For openstack Ubuntu 16.04 images this will run as a service after the VM has restarted
 ./so_vm_init.sh
index 7da6223..2f36e9f 100644 (file)
@@ -26,45 +26,18 @@ then
        cp /home/ubuntu/.ssh/authorized_keys /root/.ssh
 fi
 
-# Set private IP in /etc/network/interfaces manually in the presence of public interface
-# Some VM images don't add the private interface automatically, we have to do it during the component installation
-if [[ $CLOUD_ENV == "openstack_nofloat" ]]
-then
-       LOCAL_IP=$(cat /opt/config/local_ip_addr.txt)
-       CIDR=$(cat /opt/config/oam_network_cidr.txt)
-       BITMASK=$(echo $CIDR | cut -d"/" -f2)
-
-       # Compute the netmask based on the network cidr
-       if [[ $BITMASK == "8" ]]
-       then
-               NETMASK=255.0.0.0
-       elif [[ $BITMASK == "16" ]]
-       then
-               NETMASK=255.255.0.0
-       elif [[ $BITMASK == "24" ]]
-       then
-               NETMASK=255.255.255.0
-       fi
-
-       echo "auto eth1" >> /etc/network/interfaces
-       echo "iface eth1 inet static" >> /etc/network/interfaces
-       echo "    address $LOCAL_IP" >> /etc/network/interfaces
-       echo "    netmask $NETMASK" >> /etc/network/interfaces
-       echo "    mtu $MTU" >> /etc/network/interfaces
-       ifup eth1
-fi
-
 # Download dependencies
 apt-get update
 apt-get install -y apt-transport-https ca-certificates wget git ntp ntpdate make
 
 # Download scripts from Nexus
 unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip vid_vm_init.sh > /opt/vid_vm_init.sh
-unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip vid_serv.sh > /opt/vid_serv.sh
+unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip serv.sh > /opt/vid_serv.sh
 unzip -p -j /opt/boot-$ARTIFACTS_VERSION.zip imagetest.sh > /opt/imagetest.sh
 chmod +x /opt/imagetest.sh
 chmod +x /opt/vid_vm_init.sh
 chmod +x /opt/vid_serv.sh
+sed -i "s|cmd=\"\"|cmd=\"./vid_vm_init.sh\"|g" /opt/vid_serv.sh
 mv /opt/vid_serv.sh /etc/init.d
 update-rc.d vid_serv.sh defaults
 
diff --git a/boot/vid_serv.sh b/boot/vid_serv.sh
deleted file mode 100644 (file)
index 8e92d20..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-#!/bin/sh
-### BEGIN INIT INFO
-# Provides:
-# Required-Start:    $remote_fs $syslog
-# Required-Stop:     $remote_fs $syslog
-# Default-Start:     2 3 4 5
-# Default-Stop:      0 1 6
-# Short-Description: Start daemon at boot time
-# Description:       Enable service provided by daemon.
-### END INIT INFO
-HTTP_PROXY=$(cat /opt/config/http_proxy.txt)
-HTTPS_PROXY=$(cat /opt/config/https_proxy.txt)
-
-if [ $HTTP_PROXY != "no_proxy" ]
-then
-    export http_proxy=$HTTP_PROXY
-    export https_proxy=$HTTPS_PROXY
-fi
-
-dir="/opt"
-cmd="./vid_vm_init.sh"
-user="root"
-
-name=`basename $0`
-pid_file="/var/run/$name.pid"
-stdout_log="/var/log/$name.log"
-stderr_log="/var/log/$name.err"
-
-get_pid() {
-    cat "$pid_file"
-}
-
-is_running() {
-    [ -f "$pid_file" ] && ps `get_pid` > /dev/null 2>&1
-}
-
-case "$1" in
-    start)
-    if is_running; then
-        echo "Already started"
-    else
-        echo "Starting $name"
-        cd "$dir"
-        if [ -z "$user" ]; then
-            sudo $cmd >> "$stdout_log" 2>> "$stderr_log" &
-        else
-            sudo -u "$user" $cmd >> "$stdout_log" 2>> "$stderr_log" &
-        fi
-        echo $! > "$pid_file"
-        if ! is_running; then
-            echo "Unable to start, see $stdout_log and $stderr_log"
-            exit 1
-        fi
-    fi
-    ;;
-    stop)
-    if is_running; then
-        echo -n "Stopping $name.."
-        kill `get_pid`
-        for i in {1..10}
-        do
-            if ! is_running; then
-                break
-            fi
-
-            echo -n "."
-            sleep 1
-        done
-        echo
-
-        if is_running; then
-            echo "Not stopped; may still be shutting down or shutdown may have failed"
-            exit 1
-        else
-            echo "Stopped"
-            if [ -f "$pid_file" ]; then
-                rm "$pid_file"
-            fi
-        fi
-    else
-        echo "Not running"
-    fi
-    ;;
-    restart)
-    $0 stop
-    if is_running; then
-        echo "Unable to stop, will not attempt to start"
-        exit 1
-    fi
-    $0 start
-    ;;
-    status)
-    if is_running; then
-        echo "Running"
-    else
-        echo "Stopped"
-        exit 1
-    fi
-    ;;
-    *)
-    echo "Usage: $0 {start|stop|restart|status}"
-    exit 1
-    ;;
-esac
-
-exit 0