From c50e5e68c7d4863c26700ced7ea31a18ddfc1c66 Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Wed, 19 Aug 2015 14:27:47 -0700 Subject: [PATCH] Fix bin/mail_room. --- bin/mail_room | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/bin/mail_room b/bin/mail_room index 0fabfa778b7..f4f1a170c04 100755 --- a/bin/mail_room +++ b/bin/mail_room @@ -4,6 +4,7 @@ cd $(dirname $0)/.. app_root=$(pwd) mail_room_pidfile="$app_root/tmp/pids/mail_room.pid" +mail_room_logfile="$app_root/log/mail_room.log" mail_room_config="$app_root/config/mail_room.yml" get_mail_room_pid() @@ -18,7 +19,7 @@ get_mail_room_pid() start() { - bundle exec mail_room -q -c $mail_room_config + bundle exec mail_room -q -c $mail_room_config >> $mail_room_logfile 2>&1 & PID=$! echo $PID > $mail_room_pidfile } @@ -26,13 +27,13 @@ start() stop() { get_mail_room_pid - kill -QUIT $mail_room_pid + kill -TERM $mail_room_pid } -reload() +restart() { - get_mail_room_pid - kill -USR2 $mail_room_pid + stop + start } case "$1" in @@ -42,10 +43,10 @@ case "$1" in stop) stop ;; - reload) - reload + restart) + restart ;; *) - echo "Usage: $0 {start|stop|reload}" + echo "Usage: $0 {start|stop|restart}" ;; esac