forked from GEANT/FOD
-
Notifications
You must be signed in to change notification settings - Fork 0
/
supervisorctl-fod.sh
executable file
·77 lines (60 loc) · 1.04 KB
/
supervisorctl-fod.sh
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/bin/sh
mode="$1"
shift 1
case "$mode" in
status|status-fod)
supervisorctl status
pgrep gunicorn
pgrep celery
;;
start|start-fod)
"$0" start-gunicorn
"$0" start-celeryd
;;
start-gunicorn)
supervisorctl start gunicorn
supervisorctl status gunicorn
sleep 1
pgrep gunicorn
;;
start-celeryd)
supervisorctl start celeryd
supervisorctl status celeryd
sleep 1
pgrep celery
;;
##
stop|stop-fod)
"$0" stop-gunicorn
"$0" stop-celeryd
;;
stop-gunicorn)
supervisorctl stop gunicorn
supervisorctl status gunicorn
pgrep gunicorn
sleep 1
pkill gunicorn
pgrep gunicorn
;;
stop-celeryd)
supervisorctl stop celeryd
supervisorctl status celeryd
pgrep celery
sleep 1
pkill celery
pgrep celery
;;
##
restart|restart-fod)
"$0" stop-fod
"$0" start-fod
;;
restart-gunicorn)
"$0" stop-gunicorn
"$0" start-gunicorn
;;
restart-celeryd)
"$0" stop-celeryd
"$0" start-celeryd
;;
esac