diff --git a/shell/wrapper/src/main/resources/org/apache/karaf/shell/wrapper/unix/karaf-service b/shell/wrapper/src/main/resources/org/apache/karaf/shell/wrapper/unix/karaf-service index 275f9b1..f5adf71 100755 --- a/shell/wrapper/src/main/resources/org/apache/karaf/shell/wrapper/unix/karaf-service +++ b/shell/wrapper/src/main/resources/org/apache/karaf/shell/wrapper/unix/karaf-service @@ -326,6 +326,7 @@ checkUser() { # Still want to change users, recurse. This means that the user will only be # prompted for a password once. su -m $RUN_AS_USER -s /bin/sh -c "$REALPATH $1" + RETVAL=$? # Now that we are the original user again, we may need to clean up the lock file. if [ "X$LOCKPROP" != "X" ] @@ -341,7 +342,7 @@ checkUser() { fi fi - exit 0 + exit $RETVAL fi }