diff --git a/etc/init.d/noosfero b/etc/init.d/noosfero index c06aae9..c7bcece 100755 --- a/etc/init.d/noosfero +++ b/etc/init.d/noosfero @@ -115,8 +115,11 @@ do_stop() { } do_restart() { - do_stop - do_start + if running; then + main_script restart + else + do_start + fi } running(){ diff --git a/script/production b/script/production index 1a8fb61..6403f12 100755 --- a/script/production +++ b/script/production @@ -45,6 +45,16 @@ do_stop() { stop_via_pid_file tmp/pids/delayed_job.pid tmp/pids/delayed_job.*.pid tmp/pids/feed-updater.*.pid } +do_restart() { + rake db:migrate SCHEMA=/dev/null + environments_loop stop || + stop_via_pid_file tmp/pids/delayed_job.pid tmp/pids/delayed_job.*.pid tmp/pids/feed-updater.*.pid + environments_loop start + + clear_cache + ruby -S thin -C config/thin.yml restart --onebyone +} + stop_via_pid_file() { for pidfile in $@; do if [ -e "$pidfile" ]; then @@ -84,9 +94,7 @@ case "$ACTION" in ;; restart) - do_stop - sleep 1 - do_start + do_restart ;; *) -- libgit2 0.21.2