Commit c50e5e68 authored by Douwe Maan's avatar Douwe Maan

Fix bin/mail_room.

parent 34026c97
...@@ -4,6 +4,7 @@ cd $(dirname $0)/.. ...@@ -4,6 +4,7 @@ cd $(dirname $0)/..
app_root=$(pwd) app_root=$(pwd)
mail_room_pidfile="$app_root/tmp/pids/mail_room.pid" 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" mail_room_config="$app_root/config/mail_room.yml"
get_mail_room_pid() get_mail_room_pid()
...@@ -18,7 +19,7 @@ get_mail_room_pid() ...@@ -18,7 +19,7 @@ get_mail_room_pid()
start() 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=$! PID=$!
echo $PID > $mail_room_pidfile echo $PID > $mail_room_pidfile
} }
...@@ -26,13 +27,13 @@ start() ...@@ -26,13 +27,13 @@ start()
stop() stop()
{ {
get_mail_room_pid get_mail_room_pid
kill -QUIT $mail_room_pid kill -TERM $mail_room_pid
} }
reload() restart()
{ {
get_mail_room_pid stop
kill -USR2 $mail_room_pid start
} }
case "$1" in case "$1" in
...@@ -42,10 +43,10 @@ case "$1" in ...@@ -42,10 +43,10 @@ case "$1" in
stop) stop)
stop stop
;; ;;
reload) restart)
reload restart
;; ;;
*) *)
echo "Usage: $0 {start|stop|reload}" echo "Usage: $0 {start|stop|restart}"
;; ;;
esac esac
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment