aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-x[-rw-r--r--]config/alert-tracks-debian.ugly2
-rw-r--r--config/crontab-example2
-rw-r--r--config/deploy.rb2
-rw-r--r--config/general.yml-example1
-rw-r--r--config/purge-varnish-debian.ugly2
-rw-r--r--doc/CHANGES.md18
-rwxr-xr-xscript/mysociety-switch-to-shared1
-rwxr-xr-xscript/rails-deploy-before-down25
8 files changed, 25 insertions, 28 deletions
diff --git a/config/alert-tracks-debian.ugly b/config/alert-tracks-debian.ugly
index 29a350a0e..c7d82d8c8 100644..100755
--- a/config/alert-tracks-debian.ugly
+++ b/config/alert-tracks-debian.ugly
@@ -16,7 +16,7 @@ NAME=!!(*= $daemon_name *)!!
DAEMON=!!(*= $vhost_dir *)!!/alaveteli/script/runner
DAEMON_ARGS="--daemon TrackMailer.alert_tracks_loop"
PIDFILE=!!(*= $vhost_dir *)!!/alert-tracks.pid
-LOGFILE=!!(*= $vhost_dir *)!!/logs/alert-tracks.log
+LOGFILE=!!(*= $vhost_dir *)!!/alaveteli/log/alert-tracks.log
DUSER=!!(*= $user *)!!
# Set RAILS_ENV - not needed if using config/rails_env.rb
# RAILS_ENV=your_rails_env
diff --git a/config/crontab-example b/config/crontab-example
index 669102149..79ba70beb 100644
--- a/config/crontab-example
+++ b/config/crontab-example
@@ -8,7 +8,7 @@ PATH=/usr/local/bin:/usr/bin:/bin
MAILTO=!!(*= $mailto *)!!
# Every 5 minutes
-*/5 * * * * !!(*= $user *)!! !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/commonlib/bin/run-with-lockfile.sh -n !!(*= $vhost_dir *)!!/change-xapian-database.lock "!!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/script/update-xapian-index verbose=true" >> !!(*= $vhost_dir *)!!/logs/update-xapian-index.log || echo "stalled?"
+*/5 * * * * !!(*= $user *)!! !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/commonlib/bin/run-with-lockfile.sh -n !!(*= $vhost_dir *)!!/change-xapian-database.lock "!!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/script/update-xapian-index verbose=true" >> !!(*= $vhost_dir *)!!/!!(*= $vcspath *)!!/log/update-xapian-index.log || echo "stalled?"
# Every 10 minutes
5,15,25,35,45,55 * * * * !!(*= $user *)!! /etc/init.d/foi-alert-tracks check
5,15,25,35,45,55 * * * * !!(*= $user *)!! /etc/init.d/foi-purge-varnish check
diff --git a/config/deploy.rb b/config/deploy.rb
index c73d16f53..9cc847dba 100644
--- a/config/deploy.rb
+++ b/config/deploy.rb
@@ -56,6 +56,7 @@ namespace :deploy do
"#{release_path}/public/foi-user-use.png" => "#{shared_path}/foi-user-use.png",
"#{release_path}/files" => "#{shared_path}/files",
"#{release_path}/cache" => "#{shared_path}/cache",
+ "#{release_path}/log" => "#{shared_path}/log",
"#{release_path}/lib/acts_as_xapian/xapiandbs" => "#{shared_path}/xapiandbs",
}
@@ -66,6 +67,7 @@ namespace :deploy do
after 'deploy:setup' do
run "mkdir -p #{shared_path}/files"
run "mkdir -p #{shared_path}/cache"
+ run "mkdir -p #{shared_path}/log"
run "mkdir -p #{shared_path}/xapiandbs"
end
end
diff --git a/config/general.yml-example b/config/general.yml-example
index b309dc11c..a6f68c52e 100644
--- a/config/general.yml-example
+++ b/config/general.yml-example
@@ -245,6 +245,7 @@ SHARED_DIRECTORIES:
- files/
- cache/
- lib/acts_as_xapian/xapiandbs/
+ - log/
- vendor/bundle
- public/assets
diff --git a/config/purge-varnish-debian.ugly b/config/purge-varnish-debian.ugly
index 3f11344f2..ebd4d9e5c 100644
--- a/config/purge-varnish-debian.ugly
+++ b/config/purge-varnish-debian.ugly
@@ -16,7 +16,7 @@ NAME=!!(*= $daemon_name *)!!
DAEMON=!!(*= $vhost_dir *)!!/alaveteli/script/runner
DAEMON_ARGS="--daemon PurgeRequest.purge_all_loop"
PIDFILE=!!(*= $vhost_dir *)!!/purge-varnish.pid
-LOGFILE=!!(*= $vhost_dir *)!!/logs/purge-varnish.log
+LOGFILE=!!(*= $vhost_dir *)!!/alaveteli/log/purge-varnish.log
DUSER=!!(*= $user *)!!
# Set RAILS_ENV - not needed if using config/rails_env.rb
# RAILS_ENV=your_rails_env
diff --git a/doc/CHANGES.md b/doc/CHANGES.md
index 777501ca5..0032706ef 100644
--- a/doc/CHANGES.md
+++ b/doc/CHANGES.md
@@ -1,3 +1,21 @@
+## rails-3-develop
+
+## Highlighted Features
+
+## Upgrade Notes
+
+* rails-post-deploy no longer handles linking `APP_ROOT/log` to a log directory
+ outside the app. Capistrano users will find that `:symlink_configuration` now
+ links `APP_ROOT/log` to `SHARED_PATH/log`. Users who aleady use the
+ `SHARED_FILES` and `SHARED_DIRECTORIES` settings in `config/general.yml`
+ should add `log/` to the `SHARED_DIRECTORIES` setting. The existing mechanism
+ for shared directories (in `script/rails-deploy-before-down`) will create the
+ necessary link to `SHARED_FILES_PATH/log`. If your existing shared log
+ directory is not at `SHARED_FILES_PATH/log`, move the directory and re-run
+ `script/rails-post-deploy` to link up the new location. If you don't use
+ `SHARED_FILES` and `SHARED_DIRECTORIES`, alaveteli will now write it's
+ application logs to `APP_ROOT/log` rather than `APP_ROOT/../logs` by default.
+
# Version 0.18
## Highlighted features
diff --git a/script/mysociety-switch-to-shared b/script/mysociety-switch-to-shared
index f82e77706..801532e57 100755
--- a/script/mysociety-switch-to-shared
+++ b/script/mysociety-switch-to-shared
@@ -23,6 +23,7 @@ mkdir -p "$SHARED_DIR"
for F in \
cache \
+ log \
public/foi-live-creation.png \
public/foi-user-use.png \
config/aliases \
diff --git a/script/rails-deploy-before-down b/script/rails-deploy-before-down
index 42284b00d..c44bfe552 100755
--- a/script/rails-deploy-before-down
+++ b/script/rails-deploy-before-down
@@ -32,31 +32,6 @@ else
OPTION_STAGING_SITE=1
fi
-# create initial log files
-if [ -e $TOP_DIR/../logs ]
-then
- # mySociety servers have logs dir in level above
- if ! [ -h log ] && [ -d log ]
- then
- # If log is a directory rather than a symlink, move that
- # directory out of the way:
- mv log log.original
- fi
- ln -sfn $TOP_DIR/../logs log
-else
- # otherwise just make the directory
- if [ -h log ]
- then
- # remove any old-style symlink first
- rm -f log
- fi
- mkdir -p log
-fi
-
-cd log
-touch development.log fastcgi.crash.log production.log test.log
-cd ..
-
# Returns 0 if an element is present in a bash array, and 1 otherwise
# Taken from: http://stackoverflow.com/a/8574392/223092
contains () {