Skip to content

Commit c5afcde

Browse files
feat(jigasi): support graceful shutdown via sidecar (#1908)
1 parent 5d40297 commit c5afcde

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/usr/bin/with-contenv bash
2+
3+
# When the jigasi is shutdown (or gracefully shutdown), it exits with code 0.
4+
# In this case, we don't want S6 to restart the service. We want to stop all
5+
# services and shutdown the container.
6+
7+
if [[ $1 -eq 0 ]]; then
8+
/opt/jitsi/shutdown.sh
9+
fi

jigasi/rootfs/opt/jitsi/shutdown.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/with-contenv bash
2+
3+
if [ -n "$AUTOSCALER_URL" ]; then
4+
# notify the sidecar of imminent shutdown
5+
PORT=${AUTOSCALER_SIDECAR_PORT:-6000}
6+
curl -d '{}' -v 0:$PORT/hook/v1/shutdown
7+
sleep 10
8+
fi
9+
10+
# shutdown everything
11+
s6-svscanctl -t /var/run/s6/services

0 commit comments

Comments
 (0)