From 9cd325a0243ffb9e290f7d5b13bbe0f0797b2207 Mon Sep 17 00:00:00 2001 From: Mathieu Baudier Date: Wed, 12 Oct 2011 21:36:23 +0000 Subject: [PATCH] Improve OSGi Boot git-svn-id: https://svn.argeo.org/commons/trunk@4815 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc --- .../src/main/rpm/usr/sbin/osgi-service | 41 ++++++---- .../dep/org.argeo.security.dep.node/pom.xml | 62 ++++++++++++++ .../org.argeo.security.dep.node.rap/pom.xml | 62 -------------- .../WEB-INF/applicationContext.xml | 12 +-- .../WEB-INF/web.xml | 9 ++- .../WEB-INF/xmlremoting-servlet.xml | 80 +++++++++---------- 6 files changed, 137 insertions(+), 129 deletions(-) diff --git a/osgi/dist/osgi-boot/src/main/rpm/usr/sbin/osgi-service b/osgi/dist/osgi-boot/src/main/rpm/usr/sbin/osgi-service index cbaecf578..7d1ad6e5c 100644 --- a/osgi/dist/osgi-boot/src/main/rpm/usr/sbin/osgi-service +++ b/osgi/dist/osgi-boot/src/main/rpm/usr/sbin/osgi-service @@ -30,14 +30,17 @@ RETVAL=0 start() { cp $CONF_DIR/config.ini $CONF_RW/config.ini touch $SHUTDOWN_FILE - cd $EXEC_DIR && $JVM \ + cd $EXEC_DIR + $JVM \ -Dosgi.bundles="org.argeo.osgi.boot.jar@start" \ -Dargeo.osgi.bundles="$CONF_DIR/modules;in=*,$LIB_DIR;in=*" \ + -Dargeo.osgi.shutdownFile="$SHUTDOWN_FILE" \ -Dlog4j.configuration="file:$CONF_DIR/log4j.properties" \ $JAVA_OPTS -jar $OSGI_FRAMEWORK \ + -clean \ -configuration "$CONF_RW" \ -data "$DATA_DIR" \ - &> $LOG_FILE & + &>> $LOG_FILE & PID=$! echo $PID > $PID_FILE echo Started $APP with pid $PID @@ -45,9 +48,20 @@ start() { } stop() { - PID=`cat $PID_FILE` + if [ -f $PID_FILE ];then + PID=`cat $PID_FILE` + else + return $RETVAL + fi rm -f $SHUTDOWN_FILE - # TODO wait for process to finish until timeout, then kill + timeout 5m sh << EOF +while kill -0 $PID &> /dev/null; do sleep 1; done +EOF + TIMEOUT_EXIT=$? + if [ $TIMEOUT_EXIT -eq 124 ];then + kill -9 $PID + fi + rm -f $PID_FILE echo Stopped $APP with pid $PID return $RETVAL } @@ -60,21 +74,20 @@ case "$2" in stop) stop ;; - restart|reload) + restart) stop - sleep 10 start RETVAL=$? ;; - condrestart) - echo Not implemented - exit 1 - ;; status) - echo Not implemented - exit 1 + if [ -f $PID_FILE ];then + PID=`cat $PID_FILE` + echo $APP is running with pid $PID ... + else + echo $APP is not running + fi ;; *) - echo $"Usage: $0 {start|stop|restart}" + echo $"Usage: $0 {start|stop|restart|status}" exit 1 -esac +esac \ No newline at end of file diff --git a/security/dep/org.argeo.security.dep.node/pom.xml b/security/dep/org.argeo.security.dep.node/pom.xml index a62f23ecb..c73ccc453 100644 --- a/security/dep/org.argeo.security.dep.node/pom.xml +++ b/security/dep/org.argeo.security.dep.node/pom.xml @@ -117,6 +117,68 @@ ${version.argeo-commons} + + + javax.annotation + com.springsource.javax.annotation + + + javax.xml.ws + com.springsource.javax.xml.ws + + + javax.xml.bind + com.springsource.javax.xml.bind + + + + + org.argeo.commons.security + org.argeo.security.dao.ldap + ${version.argeo-commons} + + + org.argeo.commons.security + org.argeo.security.ldap + 0.3.4-SNAPSHOT + + + org.argeo.commons.security + org.argeo.security.services + ${version.argeo-commons} + + + + + org.springframework.osgi + org.springframework.osgi.web.extender + + + org.springframework.osgi + org.springframework.osgi.web + + + org.argeo.commons.server + org.argeo.server.dep.tomcat + 0.3.4-SNAPSHOT + pom + + + org.argeo.commons.server + org.argeo.server.webextender + 0.3.4-SNAPSHOT + + + org.argeo.commons.server + org.argeo.server.jcr.mvc + 0.3.4-SNAPSHOT + + + org.argeo.commons.server + org.argeo.jackrabbit.webapp + ${version.argeo-commons} + + org.argeo.commons.server diff --git a/security/features/org.argeo.security.dep.node.rap/pom.xml b/security/features/org.argeo.security.dep.node.rap/pom.xml index af69f1b39..c51c4894c 100644 --- a/security/features/org.argeo.security.dep.node.rap/pom.xml +++ b/security/features/org.argeo.security.dep.node.rap/pom.xml @@ -67,68 +67,6 @@ 0.3.4-SNAPSHOT - - - javax.annotation - com.springsource.javax.annotation - - - javax.xml.ws - com.springsource.javax.xml.ws - - - javax.xml.bind - com.springsource.javax.xml.bind - - - - - org.argeo.commons.security - org.argeo.security.dao.ldap - ${version.argeo-commons} - - - org.argeo.commons.security - org.argeo.security.ldap - 0.3.4-SNAPSHOT - - - org.argeo.commons.security - org.argeo.security.services - ${version.argeo-commons} - - - - - org.springframework.osgi - org.springframework.osgi.web.extender - - - org.springframework.osgi - org.springframework.osgi.web - - - org.argeo.commons.server - org.argeo.server.dep.tomcat - 0.3.4-SNAPSHOT - pom - - - org.argeo.commons.server - org.argeo.server.webextender - 0.3.4-SNAPSHOT - - - org.argeo.commons.server - org.argeo.server.jcr.mvc - 0.3.4-SNAPSHOT - - - org.argeo.commons.server - org.argeo.jackrabbit.webapp - ${version.argeo-commons} - - org.argeo.commons.server diff --git a/server/modules/org.argeo.jackrabbit.webapp/WEB-INF/applicationContext.xml b/server/modules/org.argeo.jackrabbit.webapp/WEB-INF/applicationContext.xml index 5e941f99e..6b6a54077 100644 --- a/server/modules/org.argeo.jackrabbit.webapp/WEB-INF/applicationContext.xml +++ b/server/modules/org.argeo.jackrabbit.webapp/WEB-INF/applicationContext.xml @@ -21,16 +21,10 @@ - - - - - - - - - + + + \ No newline at end of file diff --git a/server/modules/org.argeo.jackrabbit.webapp/WEB-INF/web.xml b/server/modules/org.argeo.jackrabbit.webapp/WEB-INF/web.xml index 2371e2917..e24236b41 100644 --- a/server/modules/org.argeo.jackrabbit.webapp/WEB-INF/web.xml +++ b/server/modules/org.argeo.jackrabbit.webapp/WEB-INF/web.xml @@ -40,7 +40,7 @@ /remoting/* - + + webdav @@ -80,7 +81,7 @@ /public/webdav/* - + diff --git a/server/modules/org.argeo.jackrabbit.webapp/WEB-INF/xmlremoting-servlet.xml b/server/modules/org.argeo.jackrabbit.webapp/WEB-INF/xmlremoting-servlet.xml index 61c886765..b6e2ade82 100644 --- a/server/modules/org.argeo.jackrabbit.webapp/WEB-INF/xmlremoting-servlet.xml +++ b/server/modules/org.argeo.jackrabbit.webapp/WEB-INF/xmlremoting-servlet.xml @@ -7,45 +7,45 @@ http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file -- 2.30.2