-
Notifications
You must be signed in to change notification settings - Fork 0
/
supervisord.conf
171 lines (135 loc) · 4.99 KB
/
supervisord.conf
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
; supervisord configuration settings
; To use supervisor to manage the tool and website processes, start supvisord
; from the current directory or specify the path to the configuration file.
; Make sure any directories specified in the paths below (e.g. logfile) exist
; prior to running supervisor. Sudo is required if running software as root.
; $ sudo supervisord -c /path/to/this/supervisord.conf
; To interact with the processes managed by supervisor, use supervisorctl
; with the socket URL specified below or the configuration file. Again, use
; sudo if things are running as root.
; $ sudo supervisorctl -c /path/to/this/supervisord.conf (start|restart|stop)
; Or just log into the supervisorctl command prompt:
; $ sudo supervisorctl
[unix_http_server]
file = /srv/geneweaver/supervisord/supervisor.sock
[supervisord]
logfile = /srv/geneweaver/supervisord/supervisord.log
loglevel = error
logfile_maxbytes = 50MB
logfile_backups = 10
childlogdir = /srv/geneweaver/supervisord/
pidfile = /srv/geneweaver/supervisord/supervisord.pid
nodaemon = false
user = root
[supervisorctl]
serverurl = unix:///srv/geneweaver/supervisord/supervisor.sock
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
; Starts the database server.
;
[program:database]
user = postgres
command = pg_ctl start -D /var/lib/pgsql/data
autorestart = true
autostart = false
stdout_logfile = /srv/geneweaver/supervisord/database-out.log
stderr_logfile = /srv/geneweaver/supervisord/database-err.log
logfile_maxbytes = 50MB
logfile_backups = 10
; Starts the GW tools application.
;
; Celery complains then dies when you start its process as the root user.
; To overcome this, just set the environment variable C_FORCE_ROOT, or set
; the process to run as a regular user.
;
[program:gw-tools]
command = celery -A tools.celeryapp worker --loglevel=info
; If you've configured python to use a virtual enviroment, the celery
; application should be run from that directory. e.g. the command below:
;
; command = /srv/geneweaver/venv/bin/celery -A tools.celeryapp worker --loglevel=info
;
directory = /srv/geneweaver/
environment = C_FORCE_ROOT=1
autorestart = true
autostart = true
stdout_logfile = /srv/geneweaver/supervisord/tools-out.log
stderr_logfile = /srv/geneweaver/supervisord/tools-err.log
logfile_maxbytes = 50MB
logfile_backups = 10
; Starts the GW web app. When deploying to production, use the web-app group
; (web-proxy and web-server) to start the application.
;
[program:gw-website]
command = python2 src/application.py
; If you've configured python to use a virtual enviroment, the python
; executable should be run from that directory so all the appropriate installed
; packages are loaded. e.g. the command below:
;
; command = /srv/geneweaver/venv/bin/python src/application.py
;
directory = /srv/geneweaver/website-py
autorestart = true
autostart = true
stdout_logfile = /srv/geneweaver/supervisord/website-out.log
stderr_logfile = /srv/geneweaver/supervisord/website-err.log
logfile_maxbytes = 50MB
logfile_backups = 10
; Flask generates two separate python processes. One actually runs the
; application and another monitors and reloads on source code changes.
; Use this command to completely shutdown the web app.
; Only use this when starting the application via [gw-website].
;
[program:kill-website]
command = pkill -f application.py
directory = /srv/geneweaver/website-py
autorestart = false
autostart = false
redirect_stderr = true
; This command is intended to be used in conjuction with a webserver like
; nginx. The server will handle requests and proxy them over to the flask app.
; Change the directory to the location of the uwsgi.ini file.
;
[program:web-proxy]
directory = /srv/geneweaver/
command = uwsgi --ini uwsgi.ini
autorestart = true
autostart = false
stdout_logfile = /srv/geneweaver/supervisord/proxy-out.log
stderr_logfile = /srv/geneweaver/supervisord/proxy-err.log
logfile_maxbytes = 50MB
logfile_backups = 10
; (Re)starts the web server, nginx.
;
[program:web-server]
directory = /srv/geneweaver/website-py/src
command = systemctl restart nginx
autorestart = true
autostart = false
stdout_logfile = /srv/geneweaver/supervisord/web-server-out.log
stderr_logfile = /srv/geneweaver/supervisord/web-server-err.log
logfile_maxbytes = 50MB
logfile_backups = 10
; Start the application (web server and flask app) using "start web-app:*"
;
[group:web-app]
programs=web-server,web-proxy
; Generates new indices for the Sphinx search server.
;
[program:indexer]
user = sphinx
command = indexer --config /var/lib/sphinx/geneweaver/sphinx.conf --rotate --quiet --all
autostart = false
autorestart = false
redirect_stderr = true
stderr_logfile = /srv/geneweaver/supervisord/indexer-err.log
; Starts the sphinx search server.
;
[program:search]
user = sphinx
command = searchd --console --config /var/lib/sphinx/geneweaver/sphinx.conf
autostart = true
autorestart = true
redirect_stderr = true
stderr_logfile = /srv/geneweaver/supervisord/search-err.log
stdout_logfile = /srv/geneweaver/supervisord/search-out.log