Description
Description
The nemoclaw-start.sh script has no signal handlers. When SIGTERM is received (e.g., Docker stop, K8s pod termination), child processes are orphaned rather than gracefully shut down. This can lead to data corruption in running agent tasks.
Affected Area
- File(s): scripts/nemoclaw-start.sh
- Service(s): Container lifecycle
Related GitHub Issue Check
Notes
Tracked at #1015 with contributor assigned.
Reproduction Steps
Reproduction Steps
- Start NemoClaw inside Docker (runs
nemoclaw-start.sh as PID 1)
- Send SIGTERM to the container:
docker stop <container-id>
- Observe: Docker waits the full stop timeout (10s default) then sends SIGKILL
- The gateway and child processes are not gracefully shut down
- Verify no trap is set:
grep -n 'trap' scripts/nemoclaw-start.sh
Environment
Environment
- OS: Linux (inside Docker container)
- NemoClaw Version: v0.1.0
- Branch: main
- Runtime: Bash (nemoclaw-start.sh as PID 1 / ENTRYPOINT)
- Container / Orchestration Info: Docker container
- Network Setup: N/A
Repository
Debug Output
# Verify nemoclaw-start.sh runs as PID 1:
docker exec <container-id> cat /proc/1/cmdline | tr '\0' ' '
# Expected: /usr/local/bin/nemoclaw-start /bin/bash
# Check if any signal trap is set:
grep -n 'trap' scripts/nemoclaw-start.sh
# No SIGTERM/SIGINT trap found — signals are not forwarded to children
# Test graceful shutdown:
docker stop --time=2 <container-id>
docker logs <container-id> 2>&1 | tail -5
# Should see abrupt termination, not graceful shutdown messages
Logs
# Docker stop output:
$ docker stop --time=2 nemoclaw-container
# ... waits 2 seconds, then SIGKILL ...
# No "Shutting down gateway..." or "Cleanup complete" messages
# Gateway process killed without cleanup — may leave stale PID files / sockets
Checklist
Description
Description
The
nemoclaw-start.shscript has no signal handlers. When SIGTERM is received (e.g., Docker stop, K8s pod termination), child processes are orphaned rather than gracefully shut down. This can lead to data corruption in running agent tasks.Affected Area
Related GitHub Issue Check
Notes
Tracked at #1015 with contributor assigned.
Reproduction Steps
Reproduction Steps
nemoclaw-start.shas PID 1)grep -n 'trap' scripts/nemoclaw-start.shEnvironment
Environment
Repository
Debug Output
Logs
Checklist