Repository: karaf Updated Branches: refs/heads/master 818ab2ca3 -> 8c1e8218f
[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/9da58fcf Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/9da58fcf Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/9da58fcf Branch: refs/heads/master Commit: 9da58fcf0db5c9f45db886696a545827d52521e9 Parents: 818ab2c 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:04:54 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/9da58fcf/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 5ed04cd..dc022bc 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 @@ -309,7 +311,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/9da58fcf/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 42653d7..7ca6a0e 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 @@ -286,7 +286,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 @@ -399,7 +401,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 )
