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/02/15 10:53:09 UTC
svn commit: r1730474 -
/directory/apacheds/trunk/installers-maven-plugin/src/main/resources/org/apache/directory/server/installers/apacheds
Author: elecharny
Date: Mon Feb 15 09:53:09 2016
New Revision: 1730474
URL: http://svn.apache.org/viewvc?rev=1730474&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/apacheds
Modified: directory/apacheds/trunk/installers-maven-plugin/src/main/resources/org/apache/directory/server/installers/apacheds
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/installers-maven-plugin/src/main/resources/org/apache/directory/server/installers/apacheds?rev=1730474&r1=1730473&r2=1730474&view=diff
==============================================================================
--- directory/apacheds/trunk/installers-maven-plugin/src/main/resources/org/apache/directory/server/installers/apacheds (original)
+++ directory/apacheds/trunk/installers-maven-plugin/src/main/resources/org/apache/directory/server/installers/apacheds Mon Feb 15 09:53:09 2016
@@ -293,6 +293,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" ]
@@ -308,7 +309,7 @@ checkUser() {
fi
fi
- exit 0
+ exit $ret
fi
}
@@ -402,8 +403,20 @@ 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\" wrapper.java.additional.1=repair \"$WRAPPER_CONF\" set.INSTANCE_DIRECTORY=\"$INSTANCE_DIRECTORY\" 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() {
@@ -537,6 +550,13 @@ case "$1" in
start
;;
+ 'repair')
+ checkUser touchlock $1 $INSTANCE
+ stopit
+ repair
+ start
+ ;;
+
'stop')
checkUser "" $1 $INSTANCE
stopit