Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[BUG] Kasm does not start after an unclean shutdown when the stale containerd pid belongs to another process

Aperta
#110 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
65/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
bash, docker, shell

Direzione di ricerca

The issue is in the container's entrypoint script, likely dockerd-entrypoint.sh, which currently only deletes docker*.pid files. Examine the script to understand the startup sequence. The fix involves adding logic to clean up /run/docker/containerd/containerd.pid if it exists and points to a non-containerd process. Test by reproducing the unclean shutdown scenario and verifying dockerd starts correctly.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Is there an existing issue for this?
  • I have searched the existing issues
Current Behavior

/run is not a tmpfs in this image, so after an unclean shutdown (docker kill, power loss, OOM kill), /run/docker/containerd/containerd.pid is still there when the container starts again. dockerd-entrypoint.sh only deletes docker*.pid. If another process has been given that pid by the time dockerd starts, dockerd takes it for a running containerd (moby, pidfile.Read), never starts its own and gives up with failed to start containerd: timeout waiting for containerd to start. s6 restarts it, and it fails again for as long as that process lives.

svc-kasm/run only waits for /var/run/docker.sock to exist, so it goes on without dockerd and fails (unable to start service svc-kasm: command exited 1). Once dockerd does start, the Kasm containers come back through their restart policy, but svc-kasm stays failed, so svc-kasm/finish does not run on the next stop.

I hit it once after docker kill kasm and docker start kasm. Pointing the pid file at a process that always exists reproduces it every time.

Expected Behavior

Kasm starts after an unclean shutdown.

Steps To Reproduce
  1. Let Kasm start.
  2. docker kill kasm
  3. Make the stale pid point at a live process (pid 1 always exists): echo 1 > containerd.pid && docker cp containerd.pid kasm:/run/docker/containerd/containerd.pid
  4. docker start kasm: the log loops on failed to start containerd: timeout waiting for containerd to start, svc-kasm fails, and Kasm stays down.
Environment
- OS: Ubuntu 24.04.4 LTS (kernel 6.18, cgroup v1)
- How docker service was installed: docker-ce 29.3.1 from Docker's apt repository
- Workspace image: kasmweb/remmina:1.19.0-rolling-daily
CPU architecture

x86-64

Docker creation
docker run -d --name kasm --privileged --network host --stop-timeout 90 \
  -e KASM_PORT=443 \
  -v /path/to/kasm/data:/opt \
  lscr.io/linuxserver/kasm:1.19.0-ls150
# plus HTTPS_PROXY and a CA bundle for the test VM's egress proxy
Container logs
[migrations] started
[migrations] no migrations found
usermod: no changes
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝

   Brought to you by linuxserver.io
───────────────────────────────────────

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    911
User GID:    911
───────────────────────────────────────
Linuxserver.io version: 1.19.0-ls150
Build-date: 2026-09-22T23:50:52+00:00
───────────────────────────────────────
    
[custom-init] No custom files found, skipping...
Failed to fetch workspace list, falling back to local list.json: fetch failed
failed to start containerd: timeout waiting for containerd to start
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Pulling Latest Kasm Service Images
time="2026-09-23T12:47:32Z" level=warning msg="/opt/kasm/1.19.0/docker/docker-compose.yaml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion"
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Upgrading rolling plugins
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Starting Kasm Services
time="2026-09-23T12:47:32Z" level=warning msg="/opt/kasm/1.19.0/docker/docker-compose.yaml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion"
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
s6-rc: warning: unable to start service svc-kasm: command exited 1
failed to start containerd: timeout waiting for containerd to start
failed to start containerd: timeout waiting for containerd to start
failed to start containerd: timeout waiting for containerd to start
failed to start containerd: timeout waiting for containerd to start
failed to start containerd: timeout waiting for containerd to start
failed to start containerd: timeout waiting for containerd to start
Lingua principale
Shell
Stelle
487
Fork
51
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di linuxserver/docker-kasm

Tutte le issue di linuxserver/docker-kasm

Issue simili

Altre issue su Shell/Bash

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.