Skip to content

Commit b46ad30

Browse files
committed
Restart supervisor when a process exits with a fatal state, e.g. too many start retries too quickly
1 parent 681ef52 commit b46ad30

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

build/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,10 @@ COPY user-settings_template.yml /app/rocketpool/user-settings_template.yml
3535
COPY rocketpool-start.sh /usr/local/bin/rocketpool-start.sh
3636
COPY restart-vc.sh /usr/local/bin/restart-vc.sh
3737
COPY stop-validator.sh /usr/local/bin/stop-validator.sh
38+
COPY stop-supervisor.sh /usr/local/bin/stop-supervisor.sh
3839
RUN chmod +x /usr/local/bin/rocketpool-start.sh
3940
RUN chmod +x /usr/local/bin/restart-vc.sh
4041
RUN chmod +x /usr/local/bin/stop-validator.sh
42+
RUN chmod +x /usr/local/bin/stop-supervisor.sh
4143

4244
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]

build/stop-supervisor.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/bash
2+
3+
printf "INIT stop-supervisor.sh\n";
4+
5+
while read line; do
6+
echo "Processing Event: $line" >&2;
7+
kill -3 $(cat "/var/run/supervisord.pid")
8+
done < /dev/stdin

build/supervisord.conf

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
[supervisord]
22
nodaemon=true
3+
loglevel=info
4+
logfile=/var/log/supervisor/supervisord.log
5+
pidfile=/var/run/supervisord.pid
6+
childlogdir=/var/log/supervisor
37

48
[program:rocketpool]
59
command=/bin/sh -c "/usr/local/bin/rocketpool-start.sh"
@@ -31,3 +35,7 @@ stdout_logfile=/dev/stdout
3135
stdout_logfile_maxbytes=0
3236
stderr_logfile=/dev/stderr
3337
stderr_logfile_maxbytes=0
38+
39+
[eventlistener:processes]
40+
command=/usr/local/bin/stop-supervisor.sh
41+
events=PROCESS_STATE_STOPPED, PROCESS_STATE_FATAL

0 commit comments

Comments
 (0)