From e10192397b48d3e686fe3ba71746a9d08dfd3e66 Mon Sep 17 00:00:00 2001 From: Wouter Born Date: Fri, 14 Sep 2018 16:05:56 +0200 Subject: [PATCH] Upgrade to Karaf 4.2.1 (#761) Signed-off-by: Wouter Born --- .../userdata/etc/org.ops4j.pax.url.mvn.cfg | 60 ++++++---- .../openhab/src/main/resources/bin/karaf | 53 +++++++-- .../openhab/src/main/resources/bin/karaf.bat | 105 +++++++++++++----- .../userdata/etc/org.apache.karaf.shell.cfg | 22 ++-- .../userdata/etc/org.ops4j.pax.logging.cfg | 5 + .../userdata/etc/overrides.properties | 4 - .../etc/scripts/shell.completion.script | 31 +++++- pom.xml | 6 +- 8 files changed, 209 insertions(+), 77 deletions(-) diff --git a/distributions/openhab/src/main/filtered-resources/userdata/etc/org.ops4j.pax.url.mvn.cfg b/distributions/openhab/src/main/filtered-resources/userdata/etc/org.ops4j.pax.url.mvn.cfg index 4311742f88..4271337768 100644 --- a/distributions/openhab/src/main/filtered-resources/userdata/etc/org.ops4j.pax.url.mvn.cfg +++ b/distributions/openhab/src/main/filtered-resources/userdata/etc/org.ops4j.pax.url.mvn.cfg @@ -15,6 +15,9 @@ # * 3. if not found looks for ${maven.home}/conf/settings.xml # * 4. if not found looks for ${M2_HOME}/conf/settings.xml # +# Properties prefixed with "org.ops4j.pax.url.mvn." have +# higher priority except element. HTTP proxies should be configured in +# settings file #org.ops4j.pax.url.mvn.settings= # @@ -28,17 +31,21 @@ org.ops4j.pax.url.mvn.localRepository=${openhab.userdata}/tmp/mvn # # Default this to false. It's just weird to use undocumented repos +# "false" means that http://repo1.maven.org/maven2@id=central won't be +# implicitly used as remote repository # org.ops4j.pax.url.mvn.useFallbackRepositories=false -# -# Uncomment if you don't wanna use the proxy settings -# from the Maven conf/settings.xml file -# -# org.ops4j.pax.url.mvn.proxySupport=false - # # Comma separated list of repositories scanned when resolving an artifact. +# list of repositories searched in the first place, should contain +# ${runtime.home}/${karaf.default.repository}. +# if "org.ops4j.pax.url.mvn.localRepository" is defined and it's not +# ~/.m2/repository, it's recommended (at least for dev purposes) to add +# ~/.m2/repository to defaultRepositories +# each of these repositories is checked by aether as "local repository". if +# artifact isn't found, "repositories" are searched next +# # Those repositories will be checked before iterating through the # below list of repositories and even before the local repository # A repository url can be appended with zero or more of the following flags: @@ -48,31 +55,36 @@ org.ops4j.pax.url.mvn.useFallbackRepositories=false # The following property value will add the system folder as a repo. # org.ops4j.pax.url.mvn.defaultRepositories=\ - file:${karaf.home}/${karaf.default.repository}@id=system.repository@snapshots, \ - file:${karaf.data}/tmp/kar@id=kar.repository@multi@snapshots, \ - file:${karaf.base}/${karaf.default.repository}@id=child.system.repository@snapshots + ${karaf.home.uri}${karaf.default.repository}@id=system.repository@snapshots, \ + ${karaf.data.uri}tmp/kar@id=kar.repository@multi@snapshots, \ + ${karaf.base.uri}${karaf.default.repository}@id=child.system.repository@snapshots -# Use the default local repo (e.g.~/.m2/repository) as a "remote" repo -#org.ops4j.pax.url.mvn.defaultLocalRepoAsRemote=false +# +# if "defaultLocalRepoAsRemote" is set to *any* value, localRepository will be +# added to the list of remote repositories being searched for artifacts +# +#org.ops4j.pax.url.mvn.defaultLocalRepoAsRemote = true # # Comma separated list of repositories scanned when resolving an artifact. -# -# Default repos: -# -# http://repo1.maven.org/maven2@id=central, \ -# http://repository.springsource.com/maven/bundles/release@id=spring.ebr.release, \ -# http://repository.springsource.com/maven/bundles/external@id=spring.ebr.external, \ -# http://zodiac.springsource.com/maven/bundles/release@id=gemini, \ -# http://repository.apache.org/content/groups/snapshots-group@id=apache@snapshots@noreleases, \ -# https://oss.sonatype.org/content/repositories/snapshots@id=sonatype.snapshots.deploy@snapshots@noreleases, \ -# https://oss.sonatype.org/content/repositories/ops4j-snapshots@id=ops4j.sonatype.snapshots.deploy@snapshots@noreleases, \ -# http://repository.springsource.com/maven/bundles/external@id=spring-ebr-repository@snapshots@noreleases, \ -# +# list of repositories searched after resolution fails for "defaultRepositories" +# These are true remote repositories accessed using maven/aether/wagon +# mechanisms. If any repository contains required artifact, it is then written +# to "localRepository" +# +# if this list is _prepended_ with '+' sign, all repositories from active +# profiles defined in effective settings.xml file will be _appended_ to this +# list +# The default list includes the following repositories: +# http://repo1.maven.org/maven2@id=central +# http://repository.apache.org/content/groups/snapshots-group@id=apache@snapshots@noreleases +# https://oss.sonatype.org/content/repositories/snapshots@id=sonatype.snapshots.deploy@snapshots@noreleases +# https://oss.sonatype.org/content/repositories/ops4j-snapshots@id=ops4j.sonatype.snapshots.deploy@snapshots@noreleases # A repository url can be appended with zero or more of the following flags: # @snapshots : the repository contains snapshots # @noreleases : the repository does not contain any released artifacts -# @id=repository.id : the id for the repository, just like in the settings.xml this is optional but recommended +# @id=repository.id : the id for the repository, just like in the +# settings.xml this is optional but recommended # # This contains the openhab, smart home and default repositories. # diff --git a/distributions/openhab/src/main/resources/bin/karaf b/distributions/openhab/src/main/resources/bin/karaf index 5090eca9b9..8aed279a9b 100755 --- a/distributions/openhab/src/main/resources/bin/karaf +++ b/distributions/openhab/src/main/resources/bin/karaf @@ -17,15 +17,25 @@ # realpath() { + # Use in priority xpg4 awk or nawk on SunOS as standard awk is outdated + AWK=awk + if ${solaris}; then + if [ -x /usr/xpg4/bin/awk ]; then + AWK=/usr/xpg4/bin/awk + elif [ -x /usr/bin/nawk ]; then + AWK=/usr/bin/nawk + fi + fi + READLINK_EXISTS=$(command -v readlink &> /dev/null) - if [ -z $READLINK_EXISTS ]; then + if [ -z "$READLINK_EXISTS" ]; then OURPWD=${PWD} cd "$(dirname "${1}")" || exit 2 - LINK=$(ls -l "$(basename "${1}")" | awk -F"-> " '{print $2}') + LINK=$(ls -l "$(basename "${1}")" | ${AWK} -F"-> " '{print $2}') while [ "${LINK}" ]; do echo "link: ${LINK}" >&2 cd "$(dirname "${LINK}")" || exit 2 - LINK=$(ls -l "$(basename "${1}")" | awk -F"-> " '{print $2}') + LINK=$(ls -l "$(basename "${1}")" | ${AWK} -F"-> " '{print $2}') done REALPATH="${PWD}/$(basename "${1}")" cd "${OURPWD}" || exit 2 @@ -48,6 +58,7 @@ realpath() { REALNAME=$(realpath "$0") DIRNAME=$(dirname "${REALNAME}") PROGNAME=$(basename "${REALNAME}") +LOCAL_CLASSPATH=$CLASSPATH # # Load common functions @@ -89,9 +100,14 @@ checkRootInstance() { ROOT_INSTANCE_PID=$(sed -n -e '/item.0.pid/ s/.*\= *//p' "${KARAF_DATA}/tmp/instances/instance.properties") ROOT_INSTANCE_NAME=$(sed -n -e '/item.0.name/ s/.*\= *//p' "${KARAF_DATA}/tmp/instances/instance.properties") if [ "${ROOT_INSTANCE_PID}" -ne "0" ]; then - if ps p "${ROOT_INSTANCE_PID}" > /dev/null + if ps -p "${ROOT_INSTANCE_PID}" > /dev/null then - ROOT_INSTANCE_RUNNING=true + MAIN=org.apache.karaf.main.Main + PID_COMMAND=$("${PS_PREFIX}"ps -p "${ROOT_INSTANCE_PID}" -o args | sed 1d) + + if [ "${PID_COMMAND#*$MAIN}" != "$PID_COMMAND" ]; then + ROOT_INSTANCE_RUNNING=true + fi fi fi fi @@ -166,6 +182,7 @@ run() { fi debug=false + debugs=false nodebug=false while [ "${1}" != "" ]; do case "${1}" in @@ -177,6 +194,11 @@ run() { debug=true shift ;; + 'debugs') + debug=true + debugs=true + shift + ;; 'status') MAIN=org.apache.karaf.main.Status CHECK_ROOT_INSTANCE_RUNNING=false @@ -228,7 +250,11 @@ run() { fi if ${debug}; then if [ "x${JAVA_DEBUG_OPTS}" = "x" ]; then - JAVA_DEBUG_OPTS="${DEFAULT_JAVA_DEBUG_OPTS}" + if ${debugs}; then + JAVA_DEBUG_OPTS="${DEFAULT_JAVA_DEBUGS_OPTS}" + else + JAVA_DEBUG_OPTS="${DEFAULT_JAVA_DEBUG_OPTS}" + fi fi JAVA_OPTS="${JAVA_DEBUG_OPTS} ${JAVA_OPTS}" fi @@ -240,6 +266,10 @@ run() { echo "Updating libs..." rm -rf "${KARAF_HOME:?}/lib" mv -f "${KARAF_HOME:?}/lib.next" "${KARAF_HOME}/lib" + + echo "Updating classpath..." + CLASSPATH=$LOCAL_CLASSPATH + setupClassPath fi # Ensure the log directory exists @@ -252,19 +282,22 @@ run() { fi if [ "${ROOT_INSTANCE_RUNNING}" = "false" ] || [ "${CHECK_ROOT_INSTANCE_RUNNING}" = "false" ] ; then - if [ "${VERSION}" -gt "80" ]; then + if [ "${VERSION}" -gt "8" ]; then ${KARAF_EXEC} "${JAVA}" ${JAVA_OPTS} \ + --add-reads=java.xml=java.logging \ + --patch-module java.base=lib/endorsed/org.apache.karaf.specs.locator-4.2.1.jar \ + --patch-module java.xml=lib/endorsed/org.apache.karaf.specs.java.xml-4.2.1.jar \ --add-opens java.base/java.security=ALL-UNNAMED \ --add-opens java.base/java.net=ALL-UNNAMED \ --add-opens java.base/java.lang=ALL-UNNAMED \ --add-opens java.base/java.util=ALL-UNNAMED \ + --add-opens java.naming/javax.naming.spi=ALL-UNNAMED \ + --add-opens java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED \ --add-exports=java.base/sun.net.www.protocol.http=ALL-UNNAMED \ --add-exports=java.base/sun.net.www.protocol.https=ALL-UNNAMED \ --add-exports=java.base/sun.net.www.protocol.jar=ALL-UNNAMED \ - --add-exports=java.xml.bind/com.sun.xml.internal.bind.v2.runtime=ALL-UNNAMED \ --add-exports=jdk.xml.dom/org.w3c.dom.html=ALL-UNNAMED \ --add-exports=jdk.naming.rmi/com.sun.jndi.url.rmi=ALL-UNNAMED \ - --add-modules java.xml.ws.annotation,java.corba,java.transaction,java.xml.bind,java.xml.ws \ -Dkaraf.instances="${KARAF_DATA}/tmp/instances" \ -Dkaraf.home="${KARAF_HOME}" \ -Dkaraf.base="${KARAF_BASE}" \ @@ -299,7 +332,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=$? diff --git a/distributions/openhab/src/main/resources/bin/karaf.bat b/distributions/openhab/src/main/resources/bin/karaf.bat index 1fc0652154..d7fbfa3d6e 100644 --- a/distributions/openhab/src/main/resources/bin/karaf.bat +++ b/distributions/openhab/src/main/resources/bin/karaf.bat @@ -77,8 +77,8 @@ if "%KARAF_BASE%" == "" ( if not "%KARAF_DATA%" == "" ( if not exist "%KARAF_DATA%" ( call :warn KARAF_DATA is not valid: "%KARAF_DATA%" - call :warn Creating %KARAF_DATA% - mkdir %KARAF_DATA% + call :warn Creating "%KARAF_DATA%" + mkdir "%KARAF_DATA%" ) ) if "%KARAF_DATA%" == "" ( @@ -100,6 +100,7 @@ set JAVA_MODE=-server set CLASSPATH=%LOCAL_CLASSPATH%;%KARAF_BASE%\conf set DEFAULT_JAVA_DEBUG_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 +set DEFAULT_JAVA_DEBUGS_OPTS=-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005 if "%LOCAL_CLASSPATH%" == "" goto :KARAF_CLASSPATH_EMPTY set CLASSPATH=%LOCAL_CLASSPATH%;%KARAF_BASE%\conf @@ -108,6 +109,8 @@ if "%LOCAL_CLASSPATH%" == "" goto :KARAF_CLASSPATH_EMPTY set CLASSPATH=%KARAF_BASE%\conf :KARAF_CLASSPATH_END +set CLASSPATH_INITIAL=%CLASSPATH% + rem Setup Karaf Home if exist "%KARAF_HOME%\conf\karaf-rc.cmd" call %KARAF_HOME%\conf\karaf-rc.cmd if exist "%HOME%\karaf-rc.cmd" call %HOME%\karaf-rc.cmd @@ -212,6 +215,11 @@ if not "%JAVA%" == "" goto :Check_JAVA_END set JAVA=%JAVA_HOME%\bin\java :Check_JAVA_END +rem Retrieve java version +for /f tokens^=2-5^ delims^=.-_+^" %%j in ('"%JAVA%" -fullversion 2^>^&1') do ( + if %%j==1 (set JAVA_VERSION=%%k) else (set JAVA_VERSION=%%j) +) + :CheckRootInstance set ROOT_INSTANCE_RUNNING=false if exist "%OPENHAB_USERDATA%\tmp\instances\instance.properties" ( @@ -225,8 +233,8 @@ if not "%JAVA%" == "" goto :Check_JAVA_END if "%ROOT_INSTANCE_PID%" == "~13" SET CHECK_RUNNING_CONDITION=false if "%ROOT_INSTANCE_PID%" == "0" SET CHECK_RUNNING_CONDITION=false if "%CHECK_RUNNING_CONDITION%" == "true" ( - tasklist /fi "PID eq %ROOT_INSTANCE_PID%" | find ":" > NUL - if errorlevel 1 set ROOT_INSTANCE_RUNNING=true + tasklist /FI "PID eq %ROOT_INSTANCE_PID%" 2>NUL | find /I /N "java.exe" > NUL + if not errorlevel 1 set ROOT_INSTANCE_RUNNING=true ) @@ -287,7 +295,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 @@ -310,6 +320,7 @@ if "%KARAF_PROFILER%" == "" goto :RUN if "%1" == "client" goto :EXECUTE_CLIENT if "%1" == "clean" goto :EXECUTE_CLEAN if "%1" == "debug" goto :EXECUTE_DEBUG + if "%1" == "debugs" goto :EXECUTE_DEBUGS goto :EXECUTE :EXECUTE_STOP @@ -362,6 +373,12 @@ if "%KARAF_PROFILER%" == "" goto :RUN shift goto :RUN_LOOP +:EXECUTE_DEBUGS + if "%JAVA_DEBUG_OPTS%" == "" set JAVA_DEBUG_OPTS=%DEFAULT_JAVA_DEBUGS_OPTS% + set JAVA_OPTS=%JAVA_DEBUG_OPTS% %JAVA_OPTS% + shift + goto :RUN_LOOP + :EXECUTE SET ARGS=%1 %2 %3 %4 %5 %6 %7 %8 rem Execute the Java Virtual Machine @@ -373,28 +390,65 @@ if "%KARAF_PROFILER%" == "" goto :RUN echo Updating libs... RD /S /Q "%KARAF_HOME%\lib" MOVE /Y "%KARAF_HOME%\lib.next" "%KARAF_HOME%\lib" + + echo "Updating classpath..." + set CLASSPATH=%CLASSPATH_INITIAL% + pushd "%KARAF_HOME%\lib\boot" + for %%G in (*.jar) do call:APPEND_TO_CLASSPATH %%G + popd ) SET IS_RUNNABLE=false if "%ROOT_INSTANCE_RUNNING%" == "false" SET IS_RUNNABLE=true if "%CHECK_ROOT_INSTANCE_RUNNING%" == "false" SET IS_RUNNABLE=true if "%IS_RUNNABLE%" == "true" ( - "%JAVA%" %JAVA_OPTS% %OPTS% ^ - -classpath "%CLASSPATH%" ^ - -Djava.endorsed.dirs="%JAVA_HOME%\jre\lib\endorsed;%JAVA_HOME%\lib\endorsed;%KARAF_HOME%\lib\endorsed" ^ - -Djava.ext.dirs="%JAVA_HOME%\jre\lib\ext;%JAVA_HOME%\lib\ext;%KARAF_HOME%\lib\ext" ^ - -Dkaraf.instances="%OPENHAB_USERDATA%\tmp\instances" ^ - -Dkaraf.home="%KARAF_HOME%" ^ - -Dkaraf.base="%KARAF_BASE%" ^ - -Dkaraf.etc="%KARAF_ETC%" ^ - -Dkaraf.logs="%OPENHAB_LOGDIR%" ^ - -Dkaraf.restart.jvm.supported=true ^ - -Djava.io.tmpdir="%KARAF_DATA%\tmp" ^ - -Dkaraf.data="%KARAF_DATA%" ^ - -Djava.util.logging.config.file="%KARAF_BASE%\etc\java.util.logging.properties" ^ - %KARAF_OPTS% %MAIN% %ARGS% + rem If major version is greater than 1 (meaning Java 9 or 10), we don't use endorsed lib but module + rem If major version is 1 (meaning Java 1.6, 1.7, 1.8), we use endorsed lib + if %JAVA_VERSION% GTR 8 ( + "%JAVA%" %JAVA_OPTS% %OPTS% ^ + --add-reads=java.xml=java.logging ^ + --patch-module java.base=lib/endorsed/org.apache.karaf.specs.locator-4.2.1.jar ^ + --patch-module java.xml=lib/endorsed/org.apache.karaf.specs.java.xml-4.2.1.jar ^ + --add-opens java.base/java.security=ALL-UNNAMED ^ + --add-opens java.base/java.net=ALL-UNNAMED ^ + --add-opens java.base/java.lang=ALL-UNNAMED ^ + --add-opens java.base/java.util=ALL-UNNAMED ^ + --add-opens java.naming/javax.naming.spi=ALL-UNNAMED ^ + --add-opens java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED ^ + --add-exports=java.base/sun.net.www.protocol.http=ALL-UNNAMED ^ + --add-exports=java.base/sun.net.www.protocol.https=ALL-UNNAMED ^ + --add-exports=java.base/sun.net.www.protocol.jar=ALL-UNNAMED ^ + --add-exports=jdk.xml.dom/org.w3c.dom.html=ALL-UNNAMED ^ + --add-exports=jdk.naming.rmi/com.sun.jndi.url.rmi=ALL-UNNAMED ^ + -classpath "%CLASSPATH%" ^ + -Dkaraf.instances="%OPENHAB_USERDATA%\tmp\instances" ^ + -Dkaraf.home="%KARAF_HOME%" ^ + -Dkaraf.base="%KARAF_BASE%" ^ + -Dkaraf.etc="%KARAF_ETC%" ^ + -Dkaraf.logs="%OPENHAB_LOGDIR%" ^ + -Dkaraf.restart.jvm.supported=true ^ + -Djava.io.tmpdir="%KARAF_DATA%\tmp" ^ + -Dkaraf.data="%KARAF_DATA%" ^ + -Djava.util.logging.config.file="%KARAF_BASE%\etc\java.util.logging.properties" ^ + %KARAF_SYSTEM_OPTS% %KARAF_OPTS% %MAIN% %ARGS% + ) else ( + "%JAVA%" %JAVA_OPTS% %OPTS% ^ + -classpath "%CLASSPATH%" ^ + -Djava.endorsed.dirs="%JAVA_HOME%\jre\lib\endorsed;%JAVA_HOME%\lib\endorsed;%KARAF_HOME%\lib\endorsed" ^ + -Djava.ext.dirs="%JAVA_HOME%\jre\lib\ext;%JAVA_HOME%\lib\ext;%KARAF_HOME%\lib\ext" ^ + -Dkaraf.instances="%OPENHAB_USERDATA%\tmp\instances" ^ + -Dkaraf.home="%KARAF_HOME%" ^ + -Dkaraf.base="%KARAF_BASE%" ^ + -Dkaraf.etc="%KARAF_ETC%" ^ + -Dkaraf.logs="%OPENHAB_LOGDIR%" ^ + -Dkaraf.restart.jvm.supported=true ^ + -Djava.io.tmpdir="%KARAF_DATA%\tmp" ^ + -Dkaraf.data="%KARAF_DATA%" ^ + -Djava.util.logging.config.file="%KARAF_BASE%\etc\java.util.logging.properties" ^ + %KARAF_SYSTEM_OPTS% %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 ) @@ -409,14 +463,15 @@ if "%KARAF_PROFILER%" == "" goto :RUN echo Restarting ... %KARAF_DAEMON% restart! ) - ) else ( - if ERRORLEVEL 10 ( - echo Restarting JVM... - goto EXECUTE - ) + ) + ) else ( + if ERRORLEVEL 10 ( + echo Restarting JVM... + goto EXECUTE ) ) + rem # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # :END diff --git a/distributions/openhab/src/main/resources/userdata/etc/org.apache.karaf.shell.cfg b/distributions/openhab/src/main/resources/userdata/etc/org.apache.karaf.shell.cfg index 39e876818a..f430900c77 100644 --- a/distributions/openhab/src/main/resources/userdata/etc/org.apache.karaf.shell.cfg +++ b/distributions/openhab/src/main/resources/userdata/etc/org.apache.karaf.shell.cfg @@ -1,3 +1,4 @@ + ################################################################################ # # Licensed to the Apache Software Foundation (ASF) under one or more @@ -38,6 +39,12 @@ sshIdleTimeout = 1800000 # sshRealm = karaf +# +# Role name used for SSH access authorization +# If not set, this defaults to the ${karaf.admin.role} configured in etc/system.properties +# +# sshRole = admin + # # Defines if the SFTP system is enabled or not in the SSH server # @@ -55,17 +62,11 @@ hostKey = ${karaf.etc}/host.key # hostKeyFormat = simple -# -# Role name used for SSH access authorization -# If not set, this defaults to the ${karaf.admin.role} configured in etc/system.properties -# -# sshRole = admin - # # Self defined key size in 1024, 2048, 3072, or 4096 -# If not set, this defaults to 4096. +# If not set, this defaults to 2048. # -# keySize = 4096 +# keySize = 2048 # # Specify host key algorithm, defaults to RSA @@ -80,7 +81,7 @@ hostKeyFormat = simple # 3: DEBUG # 4: TRACE # -#logLevel=1 +#logLevel = 1 # # Specify an additional welcome banner to be displayed when a user logs into the server. @@ -98,6 +99,7 @@ hostKeyFormat = simple # This property define the default value when you use the Karaf shell console. # You can change the completion mode directly in the shell console, using shell:completion command. # +completionMode = GLOBAL # # Override allowed SSH cipher algorithms. @@ -123,4 +125,4 @@ hostKeyFormat = simple # # moduli-url = external moduli-url users wanna use -completionMode = GLOBAL + diff --git a/distributions/openhab/src/main/resources/userdata/etc/org.ops4j.pax.logging.cfg b/distributions/openhab/src/main/resources/userdata/etc/org.ops4j.pax.logging.cfg index 3dbff9f755..393d7fffea 100644 --- a/distributions/openhab/src/main/resources/userdata/etc/org.ops4j.pax.logging.cfg +++ b/distributions/openhab/src/main/resources/userdata/etc/org.ops4j.pax.logging.cfg @@ -80,6 +80,11 @@ log4j2.logger.lsp4j.level = OFF log4j2.logger.karservice.name = org.apache.karaf.kar.internal.KarServiceImpl log4j2.logger.karservice.level = ERROR +# Filters warnings about small thread pools. +# The thread pool is kept small intentionally for supporting resource constrained hardware. +log4j2.logger.threadpoolbudget.name = org.eclipse.jetty.util.thread.ThreadPoolBudget +log4j2.logger.threadpoolbudget.level = ERROR + # Appenders configuration diff --git a/distributions/openhab/src/main/resources/userdata/etc/overrides.properties b/distributions/openhab/src/main/resources/userdata/etc/overrides.properties index f88c3f24b7..e69de29bb2 100644 --- a/distributions/openhab/src/main/resources/userdata/etc/overrides.properties +++ b/distributions/openhab/src/main/resources/userdata/etc/overrides.properties @@ -1,4 +0,0 @@ -mvn:org.eclipse.jetty/jetty-io/9.3.21.v20170918 -mvn:org.eclipse.jetty/jetty-util/9.3.21.v20170918 -mvn:org.eclipse.jetty.websocket/websocket-common/9.3.21.v20170918 -mvn:org.eclipse.jetty.websocket/websocket-api/9.3.21.v20170918 diff --git a/distributions/openhab/src/main/resources/userdata/etc/scripts/shell.completion.script b/distributions/openhab/src/main/resources/userdata/etc/scripts/shell.completion.script index 17b165f28f..77856338b8 100755 --- a/distributions/openhab/src/main/resources/userdata/etc/scripts/shell.completion.script +++ b/distributions/openhab/src/main/resources/userdata/etc/scripts/shell.completion.script @@ -93,7 +93,7 @@ if { %(jlineReader != null) } { complete -c shell:cd -e complete -c shell:cd -d "Change current directory" - complete -c shell:cd -a '__directories' + complete -c shell:cd -a 'wi = ($.commandLine wordIndex); if { %(wi==1) } { __directories } { [ ] }' complete -c shell:sleep -e complete -c shell:sleep -d "Pause execution for the specified amount of time" @@ -239,4 +239,33 @@ if { %(jlineReader != null) } { complete -c shell:wc -s w -l words --description "Print word count" complete -c shell:wc -a '__files' + __get_scr_components = { + list = [ ] + scrref = ($.context getServiceReference org.osgi.service.component.runtime.ServiceComponentRuntime) + scr = ($.context getService $scrref) + each ($scr getComponentDescriptionDTOs ($.context bundles)) { + $list add ((($it getClass) getField "name") get $it) + } + $.context ungetService $scrref + $list + } + + complete -c scr:config -e + complete -c scr:config -d "Show the current SCR configuration" + + complete -c scr:disable -e + complete -c scr:disable -d "Disable an enabled component" + complete -c scr:disable -a '__get_scr_components' + + complete -c scr:enable -e + complete -c scr:enable -d "Enable an disabled component" + complete -c scr:enable -a '__get_scr_components' + + complete -c scr:info -e + complete -c scr:info -d "Dump information of a component or component configuration" + complete -c scr:info -a '__get_scr_components' + + complete -c scr:list -e + complete -c scr:list -d "List component configurations of a specific bundle" + } diff --git a/pom.xml b/pom.xml index de402e169d..2de48314d3 100644 --- a/pom.xml +++ b/pom.xml @@ -57,13 +57,13 @@ 1.9.13 4.5.2 - 4.1.5 - 9.3.21 + 4.2.1 + 9.4.11.v20180605 org.slf4j slf4j-api - 1.7.7 + 1.7.12 tmp.need.a.home org.osgi.compendium.split.service.component