You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by el...@apache.org on 2016/06/22 15:40:16 UTC

svn commit: r1749725 - in /directory/apacheds/trunk/installers-maven-plugin/src/main/resources/org/apache/directory/server/installers: archive/apacheds.bat archive/apacheds.sh wrapper-installation.conf

Author: elecharny
Date: Wed Jun 22 15:40:16 2016
New Revision: 1749725

URL: http://svn.apache.org/viewvc?rev=1749725&view=rev
Log:
Added teh 'repair' command

Modified:
    directory/apacheds/trunk/installers-maven-plugin/src/main/resources/org/apache/directory/server/installers/archive/apacheds.bat
    directory/apacheds/trunk/installers-maven-plugin/src/main/resources/org/apache/directory/server/installers/archive/apacheds.sh
    directory/apacheds/trunk/installers-maven-plugin/src/main/resources/org/apache/directory/server/installers/wrapper-installation.conf

Modified: directory/apacheds/trunk/installers-maven-plugin/src/main/resources/org/apache/directory/server/installers/archive/apacheds.bat
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/installers-maven-plugin/src/main/resources/org/apache/directory/server/installers/archive/apacheds.bat?rev=1749725&r1=1749724&r2=1749725&view=diff
==============================================================================
--- directory/apacheds/trunk/installers-maven-plugin/src/main/resources/org/apache/directory/server/installers/archive/apacheds.bat (original)
+++ directory/apacheds/trunk/installers-maven-plugin/src/main/resources/org/apache/directory/server/installers/archive/apacheds.bat Wed Jun 22 15:40:16 2016
@@ -19,10 +19,12 @@ REM  under the License.
 
 REM Getting the instance name from the first argument
 set INSTANCE_NAME=%1
+set ACTION=%2
 
 
 REM If there is no first argument, setting the instance name to 'default'
 IF [%1]==[] set INSTANCE_NAME=default
+if [%2]==[] set ACTION=start
 
 
 REM Printing instance information
@@ -38,4 +40,4 @@ set ADS_CONTROLS="-Dapacheds.controls="
 set ADS_EXTENDED_OPERATIONS="-Dapacheds.extendedOperations="
 
 REM Launching ApacheDS
-java %ADS_CONTROLS% %ADS_EXTENDED_OPERATIONS% -Dlog4j.configuration="file:../instances/%INSTANCE_NAME%/conf/log4j.properties" -Dapacheds.log.dir=../instances/%INSTANCE_NAME%/log -cp %ADS_CLASSPATH% org.apache.directory.server.UberjarMain ../instances/%INSTANCE_NAME%
+java %ADS_CONTROLS% %ADS_EXTENDED_OPERATIONS% -Dlog4j.configuration="file:../instances/%INSTANCE_NAME%/conf/log4j.properties" -Dapacheds.log.dir=../instances/%INSTANCE_NAME%/log -cp %ADS_CLASSPATH% org.apache.directory.server.UberjarMain ../instances/%INSTANCE_NAME% %ACTION%

Modified: directory/apacheds/trunk/installers-maven-plugin/src/main/resources/org/apache/directory/server/installers/archive/apacheds.sh
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/installers-maven-plugin/src/main/resources/org/apache/directory/server/installers/archive/apacheds.sh?rev=1749725&r1=1749724&r2=1749725&view=diff
==============================================================================
--- directory/apacheds/trunk/installers-maven-plugin/src/main/resources/org/apache/directory/server/installers/archive/apacheds.sh (original)
+++ directory/apacheds/trunk/installers-maven-plugin/src/main/resources/org/apache/directory/server/installers/archive/apacheds.sh Wed Jun 22 15:40:16 2016
@@ -157,6 +157,27 @@ if [ "$ADS_ACTION" = "start" ]; then
         org.apache.directory.server.UberjarMain "\"$ADS_INSTANCE\"" \
         > "$ADS_OUT" 2>&1 "&"
     echo $! > "$ADS_PID"
+elif [ "$ADS_ACTION" = "repair" ]; then
+    # Printing instance information
+    [ $HAVE_TTY -eq 1 ] && echo "Repairing ApacheDS instance '$ADS_INSTANCE_NAME'..."
+
+    if [ -f $ADS_PID ]; then
+        PID=`cat $ADS_PID`
+        if kill -0 $PID > /dev/null 2>&1; then
+            echo "ApacheDS is already running as $PID"
+            exit 0
+        fi
+    fi
+
+    # Repairing ApacheDS
+    eval "\"$RUN_JAVA\"" $JAVA_OPTS $ADS_CONTROLS $ADS_EXTENDED_OPERATIONS \
+        -Dlog4j.configuration="\"file:$ADS_INSTANCE/conf/log4j.properties\"" \
+        -Dapacheds.shutdown.port="\"$ADS_SHUTDOWN_PORT\"" \
+        -Dapacheds.log.dir="\"$ADS_INSTANCE/log\"" \
+        -classpath "\"$CLASSPATH\"" \
+        org.apache.directory.server.UberjarMain "\"$ADS_INSTANCE\"" repair \
+        > "$ADS_OUT" 2>&1 "&"
+    echo $! > "$ADS_PID"
 elif [ "$ADS_ACTION" = "run" ]; then
     # Printing instance information
     [ $HAVE_TTY -eq 1 ] && echo "Running ApacheDS instance '$ADS_INSTANCE_NAME'..."

Modified: directory/apacheds/trunk/installers-maven-plugin/src/main/resources/org/apache/directory/server/installers/wrapper-installation.conf
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/installers-maven-plugin/src/main/resources/org/apache/directory/server/installers/wrapper-installation.conf?rev=1749725&r1=1749724&r2=1749725&view=diff
==============================================================================
--- directory/apacheds/trunk/installers-maven-plugin/src/main/resources/org/apache/directory/server/installers/wrapper-installation.conf (original)
+++ directory/apacheds/trunk/installers-maven-plugin/src/main/resources/org/apache/directory/server/installers/wrapper-installation.conf Wed Jun 22 15:40:16 2016
@@ -35,6 +35,7 @@ wrapper.java.additional.2=-Dapacheds.var
 wrapper.java.additional.3=-Dapacheds.log.dir=${double.quote}%INSTANCE_DIRECTORY%/log${double.quote}
 wrapper.java.additional.4=-Dapacheds.run.dir=${double.quote}%INSTANCE_DIRECTORY%/run${double.quote}
 wrapper.java.additional.5=-Dapacheds.instance=${double.quote}%INSTANCE%${double.quote}
+wrapper.java.additional.6=%REPAIR_COMMAND%
 
 # Initial Java Heap Size (in MB)
 #wrapper.java.initmemory=1024