diff options
author | Louise Crow <louise.crow@gmail.com> | 2015-03-30 16:00:02 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2015-03-30 16:00:02 +0100 |
commit | f24cc98afa25ad6010ae5316eecc15dfdb3fa79b (patch) | |
tree | c32fecb16bb2097da7dfdf90e6915fce0bf1a425 /script/compact-xapian-database | |
parent | 823e58dc69960c600230b10604a0051359173f85 (diff) | |
parent | 3c0604cf900ad274d8f6ff421d39854ccbf4b6af (diff) |
Merge branch 'release/0.21'0.21.0.0
Conflicts:
locale/cy/app.po
locale/es_NI/app.po
locale/hr/app.po
locale/is_IS/app.po
locale/sr@latin/app.po
Diffstat (limited to 'script/compact-xapian-database')
-rwxr-xr-x | script/compact-xapian-database | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/script/compact-xapian-database b/script/compact-xapian-database index 075a71cd8..0caff6394 100755 --- a/script/compact-xapian-database +++ b/script/compact-xapian-database @@ -1,6 +1,7 @@ #!/bin/bash export RAILS_ENV=$1 +if [ -z $2 ]; then DAEMON_NAME=alaveteli; else DAEMON_NAME=$2; fi set -e cd "$(dirname "$0")"/.. @@ -14,15 +15,12 @@ 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" - commonlib/bin/output-on-error /etc/init.d/apache2 restart + commonlib/bin/output-on-error service "$DAEMON_NAME" restart fi else echo >&2 "Could not find xapian-compact script; have you installed xapian-tools?" |