Skip to content

Commit c50e5e6

Browse files
author
Douwe Maan
committed
Fix bin/mail_room.
1 parent 34026c9 commit c50e5e6

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

bin/mail_room

+9-8
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ cd $(dirname $0)/..
44
app_root=$(pwd)
55

66
mail_room_pidfile="$app_root/tmp/pids/mail_room.pid"
7+
mail_room_logfile="$app_root/log/mail_room.log"
78
mail_room_config="$app_root/config/mail_room.yml"
89

910
get_mail_room_pid()
@@ -18,21 +19,21 @@ get_mail_room_pid()
1819

1920
start()
2021
{
21-
bundle exec mail_room -q -c $mail_room_config
22+
bundle exec mail_room -q -c $mail_room_config >> $mail_room_logfile 2>&1 &
2223
PID=$!
2324
echo $PID > $mail_room_pidfile
2425
}
2526

2627
stop()
2728
{
2829
get_mail_room_pid
29-
kill -QUIT $mail_room_pid
30+
kill -TERM $mail_room_pid
3031
}
3132

32-
reload()
33+
restart()
3334
{
34-
get_mail_room_pid
35-
kill -USR2 $mail_room_pid
35+
stop
36+
start
3637
}
3738

3839
case "$1" in
@@ -42,10 +43,10 @@ case "$1" in
4243
stop)
4344
stop
4445
;;
45-
reload)
46-
reload
46+
restart)
47+
restart
4748
;;
4849
*)
49-
echo "Usage: $0 {start|stop|reload}"
50+
echo "Usage: $0 {start|stop|restart}"
5051
;;
5152
esac

0 commit comments

Comments
 (0)