Make branch more stable
[lgpl/argeo-commons.git] / dist / argeo-node / base / bin / argeo-cms
index a1701a3ba41b58090b673ffc3a09c19df7e019d1..bf3afa21642151748cd651e86f8a47bf56ed6267 100755 (executable)
@@ -4,20 +4,20 @@ APP=argeo
 JVM=java
 
 BIN_DIR=`dirname "$0"`
-BASE_DIR=$BIN_DIR/..
+BASE_DIR="$(cd "$(dirname "$0")/.."; pwd -P)"
+#BASE_DIR=$BIN_DIR/..
 
 # Directories and files
 CONF_DIR=$BASE_DIR/etc/$APP
 CONF_DIRS=$CONF_DIR/conf.d
-#BASE_POLICY_ALL=/usr/share/$APP/all.policy
 BASE_CONFIG_INI=$BASE_DIR/share/$APP/config.ini
 
-#EXEC_DIR=$BASE_DIR/var/lib/$APP
 EXEC_DIR=.
 DATA_DIR=$EXEC_DIR/data
 CONF_RW=$EXEC_DIR/state
 CONFIG_INI=$CONF_RW/config.ini
 
+A2_SOURCES=a2://$BASE_DIR/share/osgi
 OSGI_INSTALL_AREA=$BASE_DIR/share/osgi/boot
 OSGI_FRAMEWORK=$OSGI_INSTALL_AREA/org.eclipse.osgi.jar
 
@@ -33,7 +33,7 @@ start() {
        mkdir -p $DATA_DIR
 
     # Merge config files
-    printf "## Equinox configuration - Generated by /usr/sbin/nodectl ##\n\n" > $CONFIG_INI
+    printf "## Equinox configuration - Generated by argeo-cms ##\n\n" > $CONFIG_INI
     cat $BASE_CONFIG_INI >> $CONFIG_INI
     printf "\n##\n## $CONF_DIR/$APP.ini\n##\n\n" >> $CONFIG_INI
     cat $CONF_DIR/$APP.ini >> $CONFIG_INI
@@ -46,6 +46,7 @@ start() {
        $JVM \
                -Dlog4j.configuration="file:$CONF_DIR/log4j.properties" \
                $JAVA_OPTS -jar $OSGI_FRAMEWORK \
+               -Dargeo.osgi.sources=$A2_SOURCES \
                -configuration "$CONF_RW" \
                -data "$DATA_DIR"
 }