directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1730475 - /directory/apacheds/trunk/installers-maven-plugin/src/main/resources/org/apache/directory/server/installers/wrapper/src/sh.script.in
Date Mon, 15 Feb 2016 09:59:20 GMT
Author: elecharny
Date: Mon Feb 15 09:59:20 2016
New Revision: 1730475

URL: http://svn.apache.org/viewvc?rev=1730475&view=rev
Log:
o Applied patch provided by Peter Jamieson for DIRSERVER-1020
o Added a repair() command

Modified:
    directory/apacheds/trunk/installers-maven-plugin/src/main/resources/org/apache/directory/server/installers/wrapper/src/sh.script.in

Modified: directory/apacheds/trunk/installers-maven-plugin/src/main/resources/org/apache/directory/server/installers/wrapper/src/sh.script.in
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/installers-maven-plugin/src/main/resources/org/apache/directory/server/installers/wrapper/src/sh.script.in?rev=1730475&r1=1730474&r2=1730475&view=diff
==============================================================================
--- directory/apacheds/trunk/installers-maven-plugin/src/main/resources/org/apache/directory/server/installers/wrapper/src/sh.script.in
(original)
+++ directory/apacheds/trunk/installers-maven-plugin/src/main/resources/org/apache/directory/server/installers/wrapper/src/sh.script.in
Mon Feb 15 09:59:20 2016
@@ -351,6 +351,7 @@ checkUser() {
         # Still want to change users, recurse.  This means that the user will only be
         #  prompted for a password once. Variables shifted by 1
         su -m $RUN_AS_USER -c "\"$REALPATH\" $2 $3"
+        ret=$?
 
         # Now that we are the original user again, we may need to clean up the lock file.
         if [ "X$LOCKPROP" != "X" ]
@@ -366,7 +367,7 @@ checkUser() {
             fi
         fi
 
-        exit 0
+        exit $ret
     fi
 }
 
@@ -417,6 +418,7 @@ usage() {
     echo "                    Press CTRL-C to stop."
     echo "      start       - Run the instance in the background"
     echo "      stop        - Stop the running instance"
+    echo "      repair      - Repair the instance"
     echo "      restart     - Restart the instance if it is already running,"
     echo "                    or start if it wasn't already running"
     echo "      status      - Display the status of the instance (running or stopped)"
@@ -449,10 +451,22 @@ start() {
          echo "$APP_LONG_NAME is already running."
          exit 1
      fi
-
-
 }
  
+repair() {
+    echo "Repairing $APP_LONG_NAME..."
+    getpid
+     if [ "X$pid" = "X" ]
+     then
+         # The string passed to eval must handles spaces in paths correctly.
+         COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" repair \"$WRAPPER_CONF\" set.REPAIR_COMMAND=repair
set.INSTANCE_HOME=$INSTANCE_HOME set.INSTANCE=$INSTANCE wrapper.syslog.ident=$APP_NAME wrapper.pidfile=\"$PIDFILE\"
wrapper.daemonize=TRUE $ANCHORPROP $IGNOREPROP $LOCKPROP"
+         eval $COMMAND_LINE
+     else
+         echo "$APP_LONG_NAME is already running."
+         exit 1
+     fi
+}
+
 stopit() {
     echo "Stopping $APP_LONG_NAME..."
     getpid
@@ -566,6 +580,13 @@ case "$1" in
         start
         ;;
 
+    'repair')
+        checkUser touchlock $1 $INSTANCE
+        stopit
+        repair
+        start
+        ;;
+
     'stop')
         checkUser "" $1 $INSTANCE
         stopit



Mime
View raw message