aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Platania <platania@research.att.com>2019-05-15 10:42:05 -0400
committerMarco Platania <platania@research.att.com>2019-05-15 10:42:05 -0400
commit51ec05ef1cc3f06c7808fa6b38793c989d5c1f81 (patch)
tree1158ac3c17ad613bfd07234d60e675e23a82f611
parenta212343c9b5ec878c87a3b9bf07c8fc4e791d758 (diff)
Add a check for honeycomb status
Change-Id: I25330086dd8a7842d015da6b57d9812e5ecad296 Issue-ID: INT-658 Signed-off-by: Marco Platania <platania@research.att.com>
-rwxr-xr-xvnfs/vFW/scripts/v_packetgen_install.sh15
-rwxr-xr-xvnfs/vFW/scripts/v_packetgen_install_arm64.sh12
2 files changed, 21 insertions, 6 deletions
diff --git a/vnfs/vFW/scripts/v_packetgen_install.sh b/vnfs/vFW/scripts/v_packetgen_install.sh
index a26d5dcc..48d7c291 100755
--- a/vnfs/vFW/scripts/v_packetgen_install.sh
+++ b/vnfs/vFW/scripts/v_packetgen_install.sh
@@ -85,14 +85,17 @@ apt-get update
apt-get install -y vpp vpp-dpdk-dkms vpp-lib vpp-dbg vpp-plugins vpp-dev
sleep 1
-# Install honeycomb restart script (workaround due to honeycomb file handle leak)
-cat > /etc/cron.hourly/honeycomb <<EOF
+# Install honeycomb restart script (workaround due to honeycomb file handle leak - check every 5 minutes if honeycomb is up)
+cat > /opt/start_honeycomb.sh <<EOF
#!/bin/bash
-VERSION=$(cat /opt/config/demo_artifacts_version.txt)
-pkill java
-/opt/honeycomb/sample-distribution-$VERSION/honeycomb &>/dev/null &disown
+PID=$(ps -u root | grep honeycomb | awk '{printf $1}')
+if [[ -z $PID ]]; then
+ VERSION=$(cat /opt/config/demo_artifacts_version.txt)
+ bash /opt/honeycomb/sample-distribution-$VERSION/honeycomb &>/dev/null &disown
+fi
EOF
-chmod +x /etc/cron.hourly/honeycomb
+chmod +x /opt/start_honeycomb.sh
+(crontab -l 2>/dev/null; echo "*/5 * * * * /opt/start_honeycomb.sh") | crontab -
# Run instantiation script
cd /opt
diff --git a/vnfs/vFW/scripts/v_packetgen_install_arm64.sh b/vnfs/vFW/scripts/v_packetgen_install_arm64.sh
index 929e5365..773baa17 100755
--- a/vnfs/vFW/scripts/v_packetgen_install_arm64.sh
+++ b/vnfs/vFW/scripts/v_packetgen_install_arm64.sh
@@ -85,6 +85,18 @@ apt-get update
apt-get -o Dpkg::Options::="--force-overwrite" install -y vpp vpp-lib vpp-dbg vpp-plugins vpp-dev dpdk dpdk-dev dpdk-igb-uio-dkms dpdk-rte-kni-dkms honeycomb
sleep 1
+# Install honeycomb restart script (workaround due to honeycomb file handle leak - check every 5 minutes if honeycomb is up)
+cat > /opt/start_honeycomb.sh <<EOF
+#!/bin/bash
+PID=$(ps -u root | grep honeycomb | awk '{printf $1}')
+if [[ -z $PID ]]; then
+ VERSION=$(cat /opt/config/demo_artifacts_version.txt)
+ bash /opt/honeycomb/sample-distribution-$VERSION/honeycomb &>/dev/null &disown
+fi
+EOF
+chmod +x /opt/start_honeycomb.sh
+(crontab -l 2>/dev/null; echo "*/5 * * * * /opt/start_honeycomb.sh") | crontab -
+
# Run instantiation script
cd /opt
mv vpacketgen.sh /etc/init.d