Skip to content

Commit c5c494f

Browse files
committed
Use supervisord
1 parent ed0e5ed commit c5c494f

3 files changed

Lines changed: 39 additions & 12 deletions

File tree

deployment/roles/deploy-dev/tasks/update-development.yaml

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,7 @@
2222
environment:
2323
PATH: "/home/dev-web-1/.cabal/bin:/home/dev-web-1/.ghcup/bin:{{ ansible_env.PATH }}"
2424

25-
- name: "Kill previous process"
26-
ansible.builtin.shell:
27-
cmd: if pgrep flora-server ; then pkill flora-server ; else echo "No process found"; fi
28-
chdir: flora-server
29-
environment:
30-
PATH: "/home/dev-web-1/.cabal/bin:/home/dev-web-1/.ghcup/bin:{{ ansible_env.PATH }}"
31-
32-
- name: "Start new instance"
33-
ansible.builtin.shell:
34-
cmd: (gmake start-release &)
25+
- name: Restart the process
26+
ansible.builtin.command:
27+
cmd: supervisorctl -c deployment/supervisord.conf start flora-server
3528
chdir: flora-server
36-
environment:
37-
PATH: "/home/dev-web-1/.cabal/bin:/home/dev-web-1/.ghcup/bin:{{ ansible_env.PATH }}"

supervisor/logs/.keep

Whitespace-only changes.

supervisord.conf

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
[supervisord]
2+
logfile = logs/supervisord.log
3+
logfile_maxbytes = 50MB
4+
logfile_backups = 10
5+
loglevel = info
6+
pidfile = supervisor/supervisord.pid
7+
nodaemon = false
8+
minfds = 1024
9+
minprocs = 200
10+
umask = 022
11+
identifier = supervisor
12+
directory = %(here)s
13+
nocleanup = true
14+
strip_ansi = true
15+
16+
[unix_http_server]
17+
file = supervisor/supervisor.sock
18+
19+
[supervisorctl]
20+
serverurl = unix://supervisor/supervisor.sock
21+
prompt = supervisor
22+
23+
[rpcinterface:supervisor]
24+
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
25+
26+
[program:flora-server]
27+
command = gmake start-release
28+
autostart = false
29+
autorestart = false
30+
stopasgroup = true
31+
stopsignal = TERM
32+
priority = 100
33+
startsecs = 10
34+
stderr_logfile = logs/flora-server.log
35+
stdout_logfile = logs/flora-server.log
36+

0 commit comments

Comments
 (0)