You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by jb...@apache.org on 2016/12/12 20:53:09 UTC
[1/3] karaf git commit: Revert "[KARAF-4188] Add support for
Systemd's watchdog"
Repository: karaf
Updated Branches:
refs/heads/karaf-4.0.x ff5792d9b -> c652bd97a
Revert "[KARAF-4188] Add support for Systemd's watchdog"
This reverts commit 020d255ca4dc4da3b94651db45c1a85fffd8a6e9.
Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/6a654fa3
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/6a654fa3
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/6a654fa3
Branch: refs/heads/karaf-4.0.x
Commit: 6a654fa3b535998ef0c0ba9c97e94ef27cfc0af1
Parents: ff5792d
Author: Jean-Baptiste Onofr� <jb...@apache.org>
Authored: Mon Dec 12 21:24:47 2016 +0100
Committer: Jean-Baptiste Onofr� <jb...@apache.org>
Committed: Mon Dec 12 21:24:47 2016 +0100
----------------------------------------------------------------------
assemblies/apache-karaf/pom.xml | 3 -
.../resources/etc/config.properties | 5 --
main/pom.xml | 8 ---
.../main/java/org/apache/karaf/main/Main.java | 35 +----------
.../org/apache/karaf/main/internal/Systemd.java | 64 --------------------
.../karaf/main/internal/SystemdDaemon.java | 34 -----------
pom.xml | 14 +----
7 files changed, 2 insertions(+), 161 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/karaf/blob/6a654fa3/assemblies/apache-karaf/pom.xml
----------------------------------------------------------------------
diff --git a/assemblies/apache-karaf/pom.xml b/assemblies/apache-karaf/pom.xml
index 3fc2053..6630dd9 100644
--- a/assemblies/apache-karaf/pom.xml
+++ b/assemblies/apache-karaf/pom.xml
@@ -205,9 +205,6 @@
<library>mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.activator/${servicemix.specs.version};type:=default;export:=true</library>
<library>mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.locator/${servicemix.specs.version};type:=default;export:=true</library>
-
- <library>mvn:net.java.dev.jna/jna/${jna.version};type:=boot;export:=false</library>
- <library>mvn:net.java.dev.jna/jna-platform/${jna.version};type:=boot;export:=false</library>
</libraries>
</configuration>
</plugin>
http://git-wip-us.apache.org/repos/asf/karaf/blob/6a654fa3/assemblies/features/base/src/main/filtered-resources/resources/etc/config.properties
----------------------------------------------------------------------
diff --git a/assemblies/features/base/src/main/filtered-resources/resources/etc/config.properties b/assemblies/features/base/src/main/filtered-resources/resources/etc/config.properties
index 62b3f24..4cf7cc7 100644
--- a/assemblies/features/base/src/main/filtered-resources/resources/etc/config.properties
+++ b/assemblies/features/base/src/main/filtered-resources/resources/etc/config.properties
@@ -212,8 +212,3 @@ org.ops4j.pax.url.mvn.requireConfigAdminConfig=true
# Don't delay the console startup. Set to true if you want the console to start after all other bundles
#
karaf.delay.console=false
-
-#
-# Enable native Karaf support for systemd's watchdog.
-#
-#karaf.systemd.enabled=false
http://git-wip-us.apache.org/repos/asf/karaf/blob/6a654fa3/main/pom.xml
----------------------------------------------------------------------
diff --git a/main/pom.xml b/main/pom.xml
index d8a387a..c7ceceb 100644
--- a/main/pom.xml
+++ b/main/pom.xml
@@ -54,14 +54,6 @@
<groupId>org.apache.karaf</groupId>
<artifactId>org.apache.karaf.util</artifactId>
</dependency>
- <dependency>
- <groupId>net.java.dev.jna</groupId>
- <artifactId>jna</artifactId>
- </dependency>
- <dependency>
- <groupId>net.java.dev.jna</groupId>
- <artifactId>jna-platform</artifactId>
- </dependency>
</dependencies>
<build>
http://git-wip-us.apache.org/repos/asf/karaf/blob/6a654fa3/main/src/main/java/org/apache/karaf/main/Main.java
----------------------------------------------------------------------
diff --git a/main/src/main/java/org/apache/karaf/main/Main.java b/main/src/main/java/org/apache/karaf/main/Main.java
index a760a66..9498082 100644
--- a/main/src/main/java/org/apache/karaf/main/Main.java
+++ b/main/src/main/java/org/apache/karaf/main/Main.java
@@ -34,13 +34,11 @@ import java.security.Security;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
-import java.util.concurrent.TimeUnit;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.apache.felix.utils.properties.Properties;
import org.apache.karaf.info.ServerInfo;
-import org.apache.karaf.main.internal.Systemd;
import org.apache.karaf.main.lock.Lock;
import org.apache.karaf.main.lock.LockCallBack;
import org.apache.karaf.main.lock.NoLock;
@@ -325,7 +323,6 @@ public class Main {
}
monitor();
registerSignalHandler();
- watchdog();
}
private void registerSignalHandler() {
@@ -407,37 +404,7 @@ public class Main {
Lock getLock() {
return lock;
}
-
- private void watchdog() {
- if(Boolean.getBoolean("karaf.systemd.enabled")) {
- new Thread("Karaf Systemd Watchdog Thread") {
- public void run() {
- try {
- doWatchdog();
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }.start();
- }
- }
-
- private void doWatchdog() throws Exception {
- Systemd systemd = new Systemd();
- long timeout = systemd.getWatchdogTimeout(TimeUnit.MILLISECONDS);
-
- int code;
- while (!exiting && timeout > 0) {
- code = systemd.notifyWatchdog();
- if(code < 0) {
- System.err.println("Systemd sd_notify failed with error code: " + code);
- break;
- }
-
- Thread.sleep(timeout / 2);
- }
- }
-
+
private ClassLoader createClassLoader(ArtifactResolver resolver) throws Exception {
List<URL> urls = new ArrayList<URL>();
urls.add(resolver.resolve(config.frameworkBundle).toURL());
http://git-wip-us.apache.org/repos/asf/karaf/blob/6a654fa3/main/src/main/java/org/apache/karaf/main/internal/Systemd.java
----------------------------------------------------------------------
diff --git a/main/src/main/java/org/apache/karaf/main/internal/Systemd.java b/main/src/main/java/org/apache/karaf/main/internal/Systemd.java
deleted file mode 100644
index 888bc8b..0000000
--- a/main/src/main/java/org/apache/karaf/main/internal/Systemd.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.karaf.main.internal;
-
-
-import java.util.concurrent.TimeUnit;
-
-
-public class Systemd {
- public static final String ENV_WATCHDOG_USEC = "WATCHDOG_USEC";
- public static final String ENV_MAIN_PID = "SYSTEMD_MAIN_PID";
-
- private final String mainPid;
-
- public Systemd() {
- this.mainPid = System.getProperty("karaf.systemd.main.pid", System.getenv(ENV_MAIN_PID));
- }
-
- public int notifyWatchdog() {
- int rc = -1;
-
- // WATCHDOG : tells the service manager to update the watchdog timestamp.
- // This is the keep-alive ping that services need to issue in
- // regular intervals if WatchdogSec= is enabled for it.
- // MAINPID : the main process ID (PID) of the service, in case the service
- // manager did not fork off the process itself. Example: "MAINPID=4711"
- // This does not seem to work reliably so used only if system
- // property karaf.systemd.main.pid or env variable SYSTEMD_MAIN_PID
- // are set (system property takes the precedence)
- if(SystemdDaemon.INSTANCE != null) {
- rc = SystemdDaemon.INSTANCE.sd_notify(
- 0,
- (mainPid == null) ? "WATCHDOG=1" : ("MAINPID=" + mainPid + "\nWATCHDOG=1"));
- }
-
- return rc;
- }
-
- public long getWatchdogTimeout(TimeUnit timeUnit) {
- String timeouts = System.getenv(ENV_WATCHDOG_USEC);
- if(timeouts != null) {
- long micros = Long.parseLong(timeouts);
- return timeUnit.convert(micros, TimeUnit.MICROSECONDS);
- }
-
- return -1;
- }
-}
http://git-wip-us.apache.org/repos/asf/karaf/blob/6a654fa3/main/src/main/java/org/apache/karaf/main/internal/SystemdDaemon.java
----------------------------------------------------------------------
diff --git a/main/src/main/java/org/apache/karaf/main/internal/SystemdDaemon.java b/main/src/main/java/org/apache/karaf/main/internal/SystemdDaemon.java
deleted file mode 100644
index 076cf1c..0000000
--- a/main/src/main/java/org/apache/karaf/main/internal/SystemdDaemon.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.karaf.main.internal;
-
-import com.sun.jna.Library;
-import com.sun.jna.Native;
-
-
-public interface SystemdDaemon extends Library {
- SystemdDaemon INSTANCE = (SystemdDaemon) Native.loadLibrary("systemd-daemon", SystemdDaemon.class);
-
- int sd_notify(int unset_environment, String state);
- int sd_notifyf(int unset_environment, String format, Object... args);
-
- // Not available in all systemd version, should replace used of MAINPID
- // int sd_pid_notify(int pid, int unset_environment, String state);
- // int sd_pid_notifyff(int pid, int unset_environment, String format, Object... args);
-}
http://git-wip-us.apache.org/repos/asf/karaf/blob/6a654fa3/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 909fb28..e3dd03d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -144,9 +144,7 @@
<asm.springsource.version>1.5.3</asm.springsource.version>
<cglib.bundle.version>3.2.4_1</cglib.bundle.version>
<cglib2.version>2.2.0</cglib2.version>
-
- <jna.version>4.2.2</jna.version>
-
+
<commons-beanutils.version>1.9.2</commons-beanutils.version>
<commons-codec.version>1.10</commons-codec.version>
<commons-compress.version>1.12</commons-compress.version>
@@ -1037,16 +1035,6 @@
<version>${felix.connect.version}</version>
</dependency>
- <dependency>
- <groupId>net.java.dev.jna</groupId>
- <artifactId>jna</artifactId>
- <version>${jna.version}</version>
- </dependency>
- <dependency>
- <groupId>net.java.dev.jna</groupId>
- <artifactId>jna-platform</artifactId>
- <version>${jna.version}</version>
- </dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
[2/3] karaf git commit: Revert "[KARAF-4555] Update to jline 2.14.2"
Posted by jb...@apache.org.
Revert "[KARAF-4555] Update to jline 2.14.2"
Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/0453b3fb
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/0453b3fb
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/0453b3fb
Branch: refs/heads/karaf-4.0.x
Commit: 0453b3fba0b32d4701226f3c69292b70b14f7ff6
Parents: 6a654fa
Author: Jean-Baptiste Onofr� <jb...@apache.org>
Authored: Mon Dec 12 21:43:17 2016 +0100
Committer: Jean-Baptiste Onofr� <jb...@apache.org>
Committed: Mon Dec 12 21:43:17 2016 +0100
----------------------------------------------------------------------
pom.xml | 7 +------
shell/table/pom.xml | 10 +++++-----
2 files changed, 6 insertions(+), 11 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/karaf/blob/0453b3fb/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index e3dd03d..e23f6dd 100644
--- a/pom.xml
+++ b/pom.xml
@@ -244,7 +244,7 @@
<hibernate.validator.version>5.0.3.Final</hibernate.validator.version>
<jansi.version>1.14</jansi.version>
<javassist.version>3.9.0.GA</javassist.version>
- <jline.version>2.14.2</jline.version>
+ <jline.version>2.14.1</jline.version>
<jledit.version>0.2.1</jledit.version>
<jsw.version>3.2.3</jsw.version>
<log4j.version>1.2.17</log4j.version>
@@ -1180,11 +1180,6 @@
<version>${log4j.version}</version>
</dependency>
<dependency>
- <groupId>org.fusesource.jansi</groupId>
- <artifactId>jansi</artifactId>
- <version>${jansi.version}</version>
- </dependency>
- <dependency>
<groupId>jline</groupId>
<artifactId>jline</artifactId>
<version>${jline.version}</version>
http://git-wip-us.apache.org/repos/asf/karaf/blob/0453b3fb/shell/table/pom.xml
----------------------------------------------------------------------
diff --git a/shell/table/pom.xml b/shell/table/pom.xml
index 6fb2349..4d76004 100644
--- a/shell/table/pom.xml
+++ b/shell/table/pom.xml
@@ -49,11 +49,6 @@
<version>2.4</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.fusesource.jansi</groupId>
- <artifactId>jansi</artifactId>
- <optional>true</optional>
- </dependency>
</dependencies>
<build>
@@ -61,6 +56,11 @@
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
+ <configuration>
+ <instructions>
+ <Import-Package>org.fusesource.jansi;version="[1.9,2)",*</Import-Package>
+ </instructions>
+ </configuration>
</plugin>
</plugins>
</build>
[3/3] karaf git commit: [KARAF-4849] Add
etc/org.apache.felix.eventadmin.impl.EventAdmin.cfg
Posted by jb...@apache.org.
[KARAF-4849] Add etc/org.apache.felix.eventadmin.impl.EventAdmin.cfg
Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/c652bd97
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/c652bd97
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/c652bd97
Branch: refs/heads/karaf-4.0.x
Commit: c652bd97a5d13f626281a5d7561ad5393a9a23a2
Parents: 0453b3f
Author: Jean-Baptiste Onofr� <jb...@apache.org>
Authored: Mon Dec 12 21:52:10 2016 +0100
Committer: Jean-Baptiste Onofr� <jb...@apache.org>
Committed: Mon Dec 12 21:52:10 2016 +0100
----------------------------------------------------------------------
....apache.felix.eventadmin.impl.EventAdmin.cfg | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/karaf/blob/c652bd97/assemblies/features/base/src/main/resources/resources/etc/org.apache.felix.eventadmin.impl.EventAdmin.cfg
----------------------------------------------------------------------
diff --git a/assemblies/features/base/src/main/resources/resources/etc/org.apache.felix.eventadmin.impl.EventAdmin.cfg b/assemblies/features/base/src/main/resources/resources/etc/org.apache.felix.eventadmin.impl.EventAdmin.cfg
new file mode 100644
index 0000000..8ab08dc
--- /dev/null
+++ b/assemblies/features/base/src/main/resources/resources/etc/org.apache.felix.eventadmin.impl.EventAdmin.cfg
@@ -0,0 +1,20 @@
+################################################################################
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+################################################################################
+org.apache.felix.eventadmin.AddTimestamp=true
+org.apache.felix.eventadmin.AddSubject=true