summaryrefslogtreecommitdiffstats
path: root/common/minimal-distribution-parent/pom.xml
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2016-09-06 12:03:32 +0200
committerMarek Gradzki <mgradzki@cisco.com>2016-09-08 07:47:06 +0200
commit064155d371e7408ec6c7580a1408402d720c6b15 (patch)
treee1e0cd07885b27e78c318e9c724eb53daf69adfb /common/minimal-distribution-parent/pom.xml
parentb589b5bb6fc4b88f74710010782b155c80433740 (diff)
HONEYCOMB-78: enable HC restart
Includes: - restart script for honeycomb - HONEYCOMBC-78 fix: jVPPRegistry.close() is not invoked in case of VPP restart. That prevents subsequent attempts to establish connection from failing (we cannot invoke vl_client_disconnect_from_vlib before connect_to_vpe on fresh vpp instance). Change-Id: Icf4d6a6a40605ed34d307a0f1405b8804ba5df53 Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'common/minimal-distribution-parent/pom.xml')
-rw-r--r--common/minimal-distribution-parent/pom.xml27
1 files changed, 21 insertions, 6 deletions
diff --git a/common/minimal-distribution-parent/pom.xml b/common/minimal-distribution-parent/pom.xml
index cdaf92582..373b642c7 100644
--- a/common/minimal-distribution-parent/pom.xml
+++ b/common/minimal-distribution-parent/pom.xml
@@ -25,7 +25,21 @@
<properties>
<nexusproxy>http://nexus.fd.io/content</nexusproxy>
- <!--<main.class>Main</main.class>-->
+ <start.script.template>
+#!/bin/sh -
+STATUS=100
+
+while [ $STATUS -eq 100 ]
+do
+ %s
+ STATUS=$?
+ echo "Honeycomb exited with status: $STATUS"
+ if [ $STATUS -eq 100 ]
+ then
+ echo "Restarting..."
+ fi
+done
+ </start.script.template>
<exec.parameters>-Xms32m -Xmx128m -XX:MetaspaceSize=32m -XX:MaxMetaspaceSize=128m</exec.parameters>
<exec.parameters.minimal>-client -Xms20m -Xmx32m -XX:MetaspaceSize=5m -XX:MaxMetaspaceSize=32m -XX:MaxMetaspaceExpansion=1m -Xss512k -XX:+UseSerialGC -Djava.compiler=NONE -Xverify:none -noverify</exec.parameters.minimal>
<debug.parameters>-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005</debug.parameters>
@@ -242,29 +256,30 @@
import java.nio.file.Paths
log.info "Generating shell exec script"
+ def scriptTemplate = properties.getOrDefault("start.script.template", "")
def args = properties.getOrDefault("exec.parameters", "")
log.debug "Additional shell exec script properties: ${args}"
def javaArgs = "${args} -jar \$(dirname \$0)/${project.artifactId}-${project.version}.jar"
def scriptParent = Paths.get(project.build.outputDirectory, "honeycomb-minimal-resources")
scriptParent.toFile().mkdirs()
- def scriptContent = "#!/bin/sh -\njava " + javaArgs
+ def scriptContent = "java " + javaArgs
log.info "Generating shell exec script as ${scriptContent}"
def scriptPath = Paths.get(scriptParent.toString(), "honeycomb")
log.info "Writing shell exec script to ${scriptPath}"
- scriptPath.toFile().text = scriptContent
+ scriptPath.toFile().text = String.format(scriptTemplate, scriptContent)
scriptPath.toFile().setExecutable(true)
scriptPath = Paths.get(scriptParent.toString(), "honeycomb-start")
log.info "Writing shell exec script to ${scriptPath}"
- scriptPath.toFile().text = scriptContent + " &amp;"
+ scriptPath.toFile().text = "\$(dirname \$0)/honeycomb &amp;"
scriptPath.toFile().setExecutable(true)
def debug_args = properties.getOrDefault("debug.parameters", "")
- def debugScriptContent = "#!/bin/sh -\njava" + " ${debug_args} " + javaArgs
+ def debugScriptContent = "java" + " ${debug_args} " + javaArgs
log.info "Generating shell debug script as ${debugScriptContent}"
scriptPath = Paths.get(scriptParent.toString(), "honeycomb-debug")
log.info "Writing shell debug script to ${scriptPath}"
- scriptPath.toFile().text = debugScriptContent
+ scriptPath.toFile().text = String.format(scriptTemplate, debugScriptContent)
scriptPath.toFile().setExecutable(true)
</source>
</configuration>