aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2015-03-30 15:46:10 +0100
committerLouise Crow <louise.crow@gmail.com>2015-03-30 15:46:10 +0100
commit3c0604cf900ad274d8f6ff421d39854ccbf4b6af (patch)
treee94940650a30f5913b0942e5f1b662c22ac6ce6a
parent930356ca5f55c116004d880822db8a48eefe70c0 (diff)
parent82f9a71a28632595e01517be80c4bfa1255657e6 (diff)
Merge branch 'no-su-for-db-compact' into release/0.21release/0.21
-rwxr-xr-xscript/compact-xapian-database5
1 files changed, 1 insertions, 4 deletions
diff --git a/script/compact-xapian-database b/script/compact-xapian-database
index 7d32d7a15..0caff6394 100755
--- a/script/compact-xapian-database
+++ b/script/compact-xapian-database
@@ -15,11 +15,8 @@ if [ -x /usr/bin/xapian-compact ];
echo >&2 "Didn't compact Xapian database because there was an existing database at $XAPIAN_DB_DIR/$RAILS_ENV.new"
exit 1
else
- OWNER=$(stat -c %U "$XAPIAN_DB_DIR/$RAILS_ENV")
export XAPIAN_DB_DIR RAILS_ENV
- su "$OWNER" <<SU
-commonlib/bin/output-on-error xapian-compact "\$XAPIAN_DB_DIR/\$RAILS_ENV" "\$XAPIAN_DB_DIR/\$RAILS_ENV.new"
-SU
+ commonlib/bin/output-on-error xapian-compact "$XAPIAN_DB_DIR/$RAILS_ENV" "$XAPIAN_DB_DIR/$RAILS_ENV.new"
mv "$XAPIAN_DB_DIR/$RAILS_ENV" "$XAPIAN_DB_DIR/$RAILS_ENV.tmp"
mv "$XAPIAN_DB_DIR/$RAILS_ENV.new" "$XAPIAN_DB_DIR/$RAILS_ENV"
rm -rf "$XAPIAN_DB_DIR/$RAILS_ENV.tmp"