aboutsummaryrefslogtreecommitdiffstats
path: root/script/compact-xapian-database
diff options
context:
space:
mode:
authorGareth Rees <ADD_EMAIL_HERE>2015-03-09 09:45:33 +0000
committerGareth Rees <ADD_EMAIL_HERE>2015-03-09 09:45:33 +0000
commit8c4e401f7a7f5ac4149f007cd0cf36968045d329 (patch)
tree87dbe29d690cc9a042bed9b7f0a54443a96657ac /script/compact-xapian-database
parent72fe6ebc5c0a2dfaf9237d4a49694ba2c81b0ba2 (diff)
parenta42eec1d3785aab81fc4a26ea740b85867417b54 (diff)
Merge branch '2165-compact-xapian-restart' into rails-3-develop
Diffstat (limited to 'script/compact-xapian-database')
-rwxr-xr-xscript/compact-xapian-database3
1 files changed, 2 insertions, 1 deletions
diff --git a/script/compact-xapian-database b/script/compact-xapian-database
index 075a71cd8..7d32d7a15 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")"/..
@@ -22,7 +23,7 @@ SU
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?"