feat(jigasi): support graceful shutdown via sidecar (#1908)
This commit is contained in:
committed by
GitHub
parent
5d40297c61
commit
c5afcde7c2
9
jigasi/rootfs/etc/services.d/jigasi/finish
Normal file
9
jigasi/rootfs/etc/services.d/jigasi/finish
Normal file
@@ -0,0 +1,9 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
|
||||
# When the jigasi is shutdown (or gracefully shutdown), it exits with code 0.
|
||||
# In this case, we don't want S6 to restart the service. We want to stop all
|
||||
# services and shutdown the container.
|
||||
|
||||
if [[ $1 -eq 0 ]]; then
|
||||
/opt/jitsi/shutdown.sh
|
||||
fi
|
||||
11
jigasi/rootfs/opt/jitsi/shutdown.sh
Executable file
11
jigasi/rootfs/opt/jitsi/shutdown.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/usr/bin/with-contenv bash
|
||||
|
||||
if [ -n "$AUTOSCALER_URL" ]; then
|
||||
# notify the sidecar of imminent shutdown
|
||||
PORT=${AUTOSCALER_SIDECAR_PORT:-6000}
|
||||
curl -d '{}' -v 0:$PORT/hook/v1/shutdown
|
||||
sleep 10
|
||||
fi
|
||||
|
||||
# shutdown everything
|
||||
s6-svscanctl -t /var/run/s6/services
|
||||
Reference in New Issue
Block a user