aboutsummaryrefslogtreecommitdiffstats
path: root/script
diff options
context:
space:
mode:
Diffstat (limited to 'script')
-rwxr-xr-xscript/compact-xapian-database7
-rwxr-xr-xscript/site-specific-install.sh8
-rwxr-xr-xscript/wad4
3 files changed, 10 insertions, 9 deletions
diff --git a/script/compact-xapian-database b/script/compact-xapian-database
index 7d32d7a15..cb2d578e6 100755
--- a/script/compact-xapian-database
+++ b/script/compact-xapian-database
@@ -15,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 service "$DAEMON_NAME" restart
+ commonlib/bin/output-on-error /usr/sbin/service "$DAEMON_NAME" restart
fi
else
echo >&2 "Could not find xapian-compact script; have you installed xapian-tools?"
diff --git a/script/site-specific-install.sh b/script/site-specific-install.sh
index 59b714fb7..fba164213 100755
--- a/script/site-specific-install.sh
+++ b/script/site-specific-install.sh
@@ -209,13 +209,15 @@ echo $DONE_MSG
if [ ! "$DEVELOPMENT_INSTALL" = true ]; then
echo -n "Creating /etc/init.d/$SITE... "
(su -l -c "cd '$REPOSITORY' && bundle exec rake config_files:convert_init_script DEPLOY_USER='$UNIX_USER' VHOST_DIR='$DIRECTORY' VCSPATH='$SITE' SITE='$SITE' SCRIPT_FILE=config/sysvinit-thin.ugly" "$UNIX_USER") > /etc/init.d/"$SITE"
- chmod a+rx /etc/init.d/"$SITE"
+ chgrp "$UNIX_USER" /etc/init.d/"$SITE"
+ chmod 754 /etc/init.d/"$SITE"
echo $DONE_MSG
fi
echo -n "Creating /etc/init.d/$SITE-alert-tracks... "
-(su -l -c "cd '$REPOSITORY' && bundle exec rake config_files:convert_init_script DEPLOY_USER='$UNIX_USER' VHOST_DIR='$DIRECTORY' SCRIPT_FILE=config/alert-tracks-debian.ugly" "$UNIX_USER") > /etc/init.d/$SITE-alert-tracks
-chmod a+rx /etc/init.d/$SITE-alert-tracks
+(su -l -c "cd '$REPOSITORY' && bundle exec rake config_files:convert_init_script DEPLOY_USER='$UNIX_USER' VHOST_DIR='$DIRECTORY' SCRIPT_FILE=config/alert-tracks-debian.ugly" "$UNIX_USER") > /etc/init.d/"$SITE-alert-tracks"
+chgrp "$UNIX_USER" /etc/init.d/"$SITE-alert-tracks"
+chmod 754 /etc/init.d/"$SITE-alert-tracks"
echo $DONE_MSG
if [ $DEFAULT_SERVER = true ] && [ x != x$EC2_HOSTNAME ]
diff --git a/script/wad b/script/wad
index 658ce37ef..98830e4a2 100755
--- a/script/wad
+++ b/script/wad
@@ -330,6 +330,8 @@ class Wad
end
def s3_configure
+ return log "ENV['S3_CREDENTIALS'] not present." unless ENV['S3_CREDENTIALS']
+
Presss.config = {
:region => s3_region,
:bucket_name => s3_bucket_name,
@@ -424,7 +426,7 @@ class Wad
end
def self.setup
- new.setup
+ ENV['S3_CREDENTIALS'] ? new.setup : new.install_bundle
end
end