[BUG] Kasm does not start after an unclean shutdown when the stale containerd pid belongs to another process
还没有人认领这个 Issue。
评估
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 新手友好度
- 65/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- bash, docker, shell
- 领域
- backend, devops, infrastructure
调研方向
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.
由索引模型根据 Issue 内容生成。
描述
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
- Let Kasm start.
docker kill kasm- 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 docker start kasm: the log loops onfailed to start containerd: timeout waiting for containerd to start,svc-kasmfails, 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
- 主要语言
- Shell
- 星标
- 487
- 派生
- 51
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
linuxserver/docker-kasm 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 45/100
linuxserver/docker-kasm#111 ·
-
难度 4/5 3-5 天 新手友好度 45/100
linuxserver/docker-kasm#107 ·
-
难度 4/5 3-5 天 新手友好度 35/100
linuxserver/docker-kasm#106 ·
-
work-in-progress
linuxserver/docker-kasm#83 · 3 条评论 · 已指派 1 人 ·
查看 linuxserver/docker-kasm 的全部 Issue
相似的 Issue
-
enhancement
难度 2/5 1-3 小时 新手友好度 65/100
-
tooling
难度 2/5 1-3 小时 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 70/100
openSUSE/python-rpm-macros#219 ·
-
难度 2/5 1-3 小时 新手友好度 70/100
YunoHost-Apps/adguardhome_ynh#258 ·
-
steam-short-session-tracker: incorrect registry backup path resets settings during automatic repair 未关闭
难度 2/5 1-3 小时 新手友好度 80/100
ValveSoftware/SteamOS#2829 ·