diff --git a/.gitignore b/.gitignore index c8ce62b222863842c71efb997deb026d657b082d..84102665c72ac3edc64204933f66464ddb2a43a6 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ config/app_config.yml config/fb_config.yml config/oauth_keys.yml config/initializers/secret_token.rb +config/redis.conf .bundle vendor/bundle/* diff --git a/script/server b/script/server index 0762c78cf2f9bcff5e340ee4f175f5c855901086..0e070ed5681cee5e21718c3dc09a23ee238d6389 100755 --- a/script/server +++ b/script/server @@ -43,6 +43,31 @@ function chk_service esac } +function redis_config +# Create/update the local redis.conf file from /etc master +{ + if [ -r "/etc/redis.conf" ]; then + redis_conf="/etc/redis.conf" + elif [ -r "/etc/redis/redis.conf" ]; then + redis_conf="/etc/redis/redis.conf" + else + echo <<- EOM + Don't know how to configure redis for this platform. Copy + the configuration file redis.conf to the config directory + and patch it manually. In particular, don't daemonize. + EOM + return + fi + + if [ config/redis.cont -nt $redis_conf ] + then + return + fi + + cp $redis_conf config/redis.conf + sed -i '/^[^#]*daemonize/s/yes/no/' config/redis.conf +} + # Scan for -p, find out what port thin is about to use. args="$DEFAULT_THIN_ARGS $@" prev_arg='' @@ -74,6 +99,8 @@ then exit 64 fi +redis_config + # Force AGPL if [ -w public -a ! -e public/source.tar.gz ]; then branch=$( git branch | awk '/^[*]/ {print $2}') @@ -99,8 +126,6 @@ fi mkdir -p -v log/thin/ bundle exec ruby ./script/websocket_server.rb& -redis-server &>log/redis.log & +redis-server config/redis.conf &>log/redis-console.log & QUEUE=* bundle exec rake resque:work& bundle exec thin start $args - -# vim:ts=4:sw=4:expandtab