diff --git a/debian/changelog b/debian/changelog index 99daaf1..e59dde9 100644 --- a/debian/changelog +++ b/debian/changelog @@ -7,8 +7,13 @@ noosfero (0.35.2~1) unstable; urgency=low mail-transport-agent. * /usr/share/dbconfig-common/scripts/noosfero/install/pgsql: run db:migrate just after db:schema:load. + * etc/init.d/noosfero: forward fix for the Lenny → Squeeze upgrade. In + Squeeze, `rails` is an empty package that depends on rails-ruby1.8, but + rails-ruby1.8 is only unpacked *after* noosfero prerm runs. This way, the + initscript must be able to stop the services without any of the Rails + libraries available. - -- Antonio Terceiro Wed, 29 Feb 2012 15:22:48 -0300 + -- Antonio Terceiro Thu, 01 Mar 2012 14:37:15 -0300 noosfero (0.35.1) unstable; urgency=low diff --git a/script/production b/script/production index bdf709e..d58c336 100755 --- a/script/production +++ b/script/production @@ -37,10 +37,34 @@ do_start() { } do_stop() { - mongrel_rails cluster::stop - ./script/delayed_job stop - ./script/feed-updater stop - ./script/ferret_server -e $RAILS_ENV stop + + # During Debian upgrades, it is possible that rails is not available (e.g. + # Lenny -> Squeeze), so the programs below might fail. If they do, we fall + # back to stopping the daemons by manually reading their PID files, killing + # them and wiping the PID files. + + mongrel_rails cluster::stop || + stop_via_pid_file tmp/pids/mongrel.*.pid + + ./script/delayed_job stop || + stop_via_pid_file tmp/pids/delayed_job.pid + + ./script/feed-updater stop || + stop_via_pid_file tmp/pids/feed-updater.default.pid + + ./script/ferret_server -e $RAILS_ENV stop || + stop_via_pid_file tmp/pids/ferret.production.pid +} + +stop_via_pid_file() { + for pidfile in $@; do + if [ -e "$pidfile" ]; then + pid=$(cat $pidfile) + echo "Sentign TERM signal to stop $pid ..." + kill -TERM "$pid" + rm -f $pidfile + fi + done } environments_loop() { -- libgit2 0.21.2