You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The protocol supports sending Unix signals to running processes:
198
-
199
-
-`SIGHUP` (1): Hangup
200
-
-`SIGINT` (2): Interrupt (Ctrl-C)
201
-
-`SIGQUIT` (3): Quit
202
-
-`SIGKILL` (9): Kill (cannot be caught)
203
-
-`SIGTERM` (15): Terminate
204
-
-`SIGSTOP` (19): Stop process
205
-
-`SIGCONT` (18): Continue process
206
-
207
-
Signals can be sent via the WebSocket stream (implementation detail for advanced clients).
208
-
209
184
## Timeout Behavior
210
185
211
186
When a timeout is specified:
@@ -214,21 +189,11 @@ When a timeout is specified:
214
189
- The exit code will be `124` (GNU timeout convention)
215
190
- Timeout is enforced in the guest, so network issues won't cause false timeouts
216
191
217
-
## PTY Signal Handling & Architecture
218
-
219
-
For TTY mode (interactive shells), **the exec-agent runs inside the container namespace** - this is critical for proper signal handling:
220
-
221
-
### Why This Matters
222
-
When the PTY and shell are in the same namespace, Ctrl+C (byte `0x03`) is correctly interpreted as SIGINT and delivered to the process. Running exec-agent in initrd namespace and using chroot for commands creates a namespace boundary that breaks signal handling.
223
-
224
-
### Implementation
225
-
The init script (`lib/system/init_script.go`):
226
-
1. Copies exec-agent into `/overlay/newroot/usr/local/bin/`
227
-
2. Bind-mounts `/dev/pts` so PTY devices are accessible in container
228
-
3. Runs exec-agent with `chroot /overlay/newroot`
192
+
## Architecture
229
193
230
-
This ensures:
231
-
- Ctrl+C, Ctrl+Z, and other terminal control sequences work correctly
232
-
- PTY and process share the same namespace
233
-
- No chroot wrapper needed when executing commands (agent is already in container)
194
+
**exec-agent runs inside the container namespace**:
195
+
- Init script copies agent binary into `/overlay/newroot/usr/local/bin/`
196
+
- Bind-mounts `/dev/pts` so PTY devices are accessible
197
+
- Runs agent with `chroot /overlay/newroot`
198
+
- Commands execute directly (no chroot wrapper needed)
0 commit comments