50/53
Sign inSign up free

847. Graceful Shutdown in Compose

medium 20 XP ~9 minHands-on lab

Labs have no container engine, so nothing is started: your files are checked with docker-compose config.

Every deploy of promo-api:

  • proxy (nginx) drops in-flight requests: nginx treats SIGTERM as "stop now"; its graceful shutdown signal is SIGQUIT.
  • worker jobs run for up to 90 seconds, but Docker kills the container 10 seconds after asking it to stop.
  • worker also starts helper processes and, as PID 1, never reaps them: ps shows dozens of zombies.

Task

In /home/student/projects/promo-api/compose.yaml:

  • proxy is stopped with SIGQUIT and gets 30 seconds to finish,
  • worker gets 2 minutes to finish and runs with an init process as PID 1,
  • images and commands stay the same.

About this machine

Ubuntu 24.04 with no internet access. You are student with passwordless sudo. The grader checks the final state of the machine, not the commands you typed. Values like names and ports are generated for you.

Teaching or writing about this? Embed this lab on your page

TerminalNot started

Your machine is ready to start

A fresh, isolated Ubuntu machine boots in a few seconds with the task already set up.

No account needed: 3 of 3 free tries left. Guest machines last 30 minutes.