aboutsummaryrefslogtreecommitdiff
path: root/system/supervisor/rc.supervisord
blob: d2cbb973f565003056ec729ef37e9bc8ea81a336 (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
#!/bin/bash

run_supervisord()
{
  /usr/bin/supervisord -c /etc/supervisord.conf "${@}"
}

run_supervisorctl()
{
  /usr/bin/supervisorctl -c /etc/supervisord.conf "${@}"
}

supervisord_start()
{
  echo "Starting supervisord..."
  run_supervisord
}

supervisord_stop()
{
  echo "Stopping supervisord..."
  run_supervisorctl shutdown
}

supervisord_restart()
{
  echo "Restarting supervisord..."
  run_supervisorctl reload
}

case "${1}" in
  start)
    supervisord_start
  ;;

  stop)
    supervisord_stop
  ;;

  restart)
    supervisord_restart
  ;;

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