`supervisord` kills the licence deactivation trap after 10 s, whatever the container stop timeout

Open
#215 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@ianpittwood is already working on this.

Since Nov 23, 2026.

  • #246 by @ianpittwood — open

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
49/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
docker
Domain
devops

Research direction

Read workbench/template/startup/base/rstudio-workbench.conf.jinja2 alongside workbench/template/scripts/startup.sh.jinja2 to understand supervisord shutdown and the deactivation EXIT trap; compare the program configuration with the README timeout guidance. Check whether the Helm chart’s configmap-startup.yaml also needs the corresponding change. Done means the documented container stop timeout allows deactivation to finish, with the floating-licence signaling concern assessed.

Written by the indexing model from the issue text.

Description

cvp:2 docker tdp:0

Problem

The README asks licence-key users to run with --stop-timeout 120 / docker stop --time 120 "to ensure proper license deactivation" (README:399-410). That cannot work: [program:rstudio-workbench] sets no stopwaitsecs, so supervisord uses its default of 10 s and SIGKILLs startup.sh's deactivate EXIT trap about 10 s after the stop begins, whatever timeout Docker or Kubernetes allows. The container still exits 0, so nothing shows the deactivation was cut short. Licence files avoid this; this is about licence keys (README Option 2), which the README still documents.

Reproduce

A stub license-manager makes deactivate take 30 s; no real licence is used.

cat > license-manager <<'EOF'
#!/bin/sh
case "$1" in
  deactivate) sleep 30 ;;
esac
exit 0
EOF
chmod +x license-manager

docker rm -f pwb-stopwait 2>/dev/null
docker run -d --name pwb-stopwait -e PWB_LICENSE=STUB-KEY \
  -v "$PWD/license-manager:/usr/lib/rstudio-server/bin/license-manager:ro" \
  posit/workbench:2026.09.0
until docker logs pwb-stopwait 2>&1 | grep -q 'rstudio-workbench entered RUNNING'; do sleep 1; done

time docker stop -t 120 pwb-stopwait
docker logs pwb-stopwait 2>/dev/null | grep -E 'received SIGTERM|Exiting|Deactivating|rstudio-workbench.*SIGKILL' | uniq
docker inspect pwb-stopwait --format '{{.State.ExitCode}}'
docker rm pwb-stopwait

Expected: the stop takes about 30 to 35 s and deactivate finishes.

Actual: docker stop -t 120 returned after 12.6 s, exit code 0:

2026-10-06 03:03:45,680 WARN received SIGTERM indicating exit request
== Exiting ==
Deactivating license ...
2026-10-06 03:03:55,972 WARN killing 'rstudio-workbench' (12) with SIGKILL
2026-10-06 03:03:55,973 WARN stopped: rstudio-workbench (terminated by SIGKILL)

Docker Desktop on macOS, Engine 29.8.2, arm64, posit/workbench:2026.09.0 (revision d7fa4e7); same result with 465de7e's startup.sh mounted over it.

Where

Possibly related: floating licences

supervisord signals only startup.sh, not rserver, and the trap's rstudio-server stop finds no pid file under --server-daemonize 0, so rserver and its license-manager acquire-lease child appear to get no signal before the container ends. With a stub lease holder we saw no signal; with stopasgroup=true it received SIGTERM. (Our test pointed at an unreachable licence server, so we set server-license-type=remote in rserver.conf to get a lease holder to observe.) We have not tested an actual release against a licence server.

Ask

Set stopwaitsecs on [program:rstudio-workbench] (below the outer timeout the README recommends, since supervisord stops other programs before and after it), and consider stopasgroup/killasgroup for the floating case. The rstudio/helm chart defines its own copy of this program section in configmap-startup.yaml, so it would need the same change.

We have more measurements (timings, the launcher-exit path, a /startup/custom workaround) if they are useful.

Dominant language
Jinja
Stars
3
Forks
0
Avg merge
3d 17h
Merged PRs (30d)
8

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from posit-dev/images-workbench

All issues in posit-dev/images-workbench

Similar issues

More DevOps issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.