Welcome to mirror list, hosted at ThFree Co, Russian Federation.

mail_room « bin - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: cf9d422909e0f6b311f16f607fbe2cc48eaabc1e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/sh

cd $(dirname $0)/.. || exit 1
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()
{
  local pid
  pid=$(cat $mail_room_pidfile)
  if [ -z "$pid" ] ; then
    echo "Could not find a PID in $mail_room_pidfile"
    exit 1
  fi
  mail_room_pid=$pid
}

start()
{
  bin/daemon_with_pidfile $mail_room_pidfile bundle exec mail_room --log-exit-as json -q -c $mail_room_config >> $mail_room_logfile 2>&1
}

stop()
{
  get_mail_room_pid
  kill -TERM $mail_room_pid
}

restart()
{
  stop
  start
}

case "$1" in
  start)
    start
    ;;
  stop)
    stop
    ;;
  restart)
    restart
    ;;
  *)
    echo "Usage: $0 {start|stop|restart}"
    ;;
esac