diff --git a/jvb/rootfs/etc/services.d/jvb/finish b/jvb/rootfs/etc/services.d/jvb/finish index 9f7171a..85a5659 100644 --- a/jvb/rootfs/etc/services.d/jvb/finish +++ b/jvb/rootfs/etc/services.d/jvb/finish @@ -5,5 +5,5 @@ # services and shutdown the container. if [[ $1 -eq 0 ]]; then - s6-svscanctl -t /var/run/s6/services + /opt/jitsi/shutdown.sh fi diff --git a/jvb/rootfs/opt/jitsi/shutdown.sh b/jvb/rootfs/opt/jitsi/shutdown.sh index 0464acb..4821f60 100755 --- a/jvb/rootfs/opt/jitsi/shutdown.sh +++ b/jvb/rootfs/opt/jitsi/shutdown.sh @@ -1,8 +1,11 @@ #!/usr/bin/with-contenv bash -# notify the sidecar of imminent shutdown -PORT=${AUTOSCALER_SIDECAR_PORT:-6000} -curl -d '{}' -v 0:$PORT/hook/v1/shutdown -sleep 10 + +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