Repository: karaf Updated Branches: refs/heads/karaf-4.1.x 42fef157a -> c1f081cff
[KARAF-5222] Made possible to force a karaf instance start even if another one has been found as running. Project: http://git-wip-us.apache.org/repos/asf/karaf/repo Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/c1f081cf Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/c1f081cf Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/c1f081cf Branch: refs/heads/karaf-4.1.x Commit: c1f081cff612dbe8a6ffedb227e135195a5bd4df Parents: 42fef15 Author: Andrea Tarocchi <[email protected]> Authored: Mon Jun 26 13:15:33 2017 +0200 Committer: Jean-Baptiste Onofré <[email protected]> Committed: Mon Jun 26 16:07:02 2017 +0200 ---------------------------------------------------------------------- .../base/src/main/filtered-resources/resources/bin/karaf | 6 ++++-- .../base/src/main/filtered-resources/resources/bin/karaf.bat | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/karaf/blob/c1f081cf/assemblies/features/base/src/main/filtered-resources/resources/bin/karaf ---------------------------------------------------------------------- diff --git a/assemblies/features/base/src/main/filtered-resources/resources/bin/karaf b/assemblies/features/base/src/main/filtered-resources/resources/bin/karaf index a2fd5cb..0eb9df0 100644 --- a/assemblies/features/base/src/main/filtered-resources/resources/bin/karaf +++ b/assemblies/features/base/src/main/filtered-resources/resources/bin/karaf @@ -152,7 +152,9 @@ init() { run() { OPTS="-Dkaraf.startLocalConsole=true -Dkaraf.startRemoteShell=true" MAIN=org.apache.karaf.main.Main - CHECK_ROOT_INSTANCE_RUNNING=true + if [ "x$CHECK_ROOT_INSTANCE_RUNNING" = "x" ]; then + CHECK_ROOT_INSTANCE_RUNNING=true + fi JAVA_ENDORSED_DIRS="${JAVA_HOME}/jre/lib/endorsed:${JAVA_HOME}/lib/endorsed:${KARAF_HOME}/lib/endorsed" JAVA_EXT_DIRS="${JAVA_HOME}/jre/lib/ext:${JAVA_HOME}/lib/ext:${KARAF_HOME}/lib/ext" if ${cygwin}; then @@ -299,7 +301,7 @@ run() { ${MAIN} "$@" fi else - die "There is a Root instance already running with name ${ROOT_INSTANCE_NAME} and pid ${ROOT_INSTANCE_PID}" + die "There is a Root instance already running with name ${ROOT_INSTANCE_NAME} and pid ${ROOT_INSTANCE_PID}. If you know what you are doing and want to force the run anyway, export CHECK_ROOT_INSTANCE_RUNNING=false and re run the command." fi KARAF_RC=$? http://git-wip-us.apache.org/repos/asf/karaf/blob/c1f081cf/assemblies/features/base/src/main/filtered-resources/resources/bin/karaf.bat ---------------------------------------------------------------------- diff --git a/assemblies/features/base/src/main/filtered-resources/resources/bin/karaf.bat b/assemblies/features/base/src/main/filtered-resources/resources/bin/karaf.bat index 2a79776..3ab7e2a 100644 --- a/assemblies/features/base/src/main/filtered-resources/resources/bin/karaf.bat +++ b/assemblies/features/base/src/main/filtered-resources/resources/bin/karaf.bat @@ -285,7 +285,9 @@ goto :EOF :CLASSPATH_END -SET CHECK_ROOT_INSTANCE_RUNNING=true +if "%CHECK_ROOT_INSTANCE_RUNNING%" == "" ( + SET CHECK_ROOT_INSTANCE_RUNNING=true +) rem Execute the JVM or the load the profiler if "%KARAF_PROFILER%" == "" goto :RUN @@ -391,7 +393,7 @@ if "%KARAF_PROFILER%" == "" goto :RUN -Djava.util.logging.config.file="%KARAF_BASE%\etc\java.util.logging.properties" ^ %KARAF_OPTS% %MAIN% %ARGS% ) else ( - echo There is a Root instance already running with name %ROOT_INSTANCE_NAME% and pid %ROOT_INSTANCE_PID% + echo There is a Root instance already running with name %ROOT_INSTANCE_NAME% and pid %ROOT_INSTANCE_PID%. If you know what you are doing and want to force the run anyway, SET CHECK_ROOT_INSTANCE_RUNNING=false and re run the command. goto :END )
