summaryrefslogtreecommitdiffstats
path: root/common/minimal-distribution-parent
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2016-09-06 12:03:32 +0200
committerMarek Gradzki <mgradzki@cisco.com>2016-09-07 13:33:33 +0200
commit49a8666711f62edf78ed59272a7446899c397922 (patch)
treed315829bea1545e306fd3c837d089da88b43c80c /common/minimal-distribution-parent
parente9eda93718d02f64ad25299a887efd976edfae4f (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')
-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 e35ab6fdb..02356cb75 100644
--- a/common/minimal-distribution-parent/pom.xml
+++ b/common/minimal-distribution-parent/pom.xml
@@ -19,7 +19,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>
@@ -147,29 +161,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>