Skip to content

Commit c7349e0

Browse files
committed
Fix test
1 parent f0d8608 commit c7349e0

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

cmd/api/api/exec_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ func TestExecWithDebianMinimal(t *testing.T) {
236236

237237
// Verify the app exited but VM is still usable (key behavior this test validates)
238238
logs = collectTestLogs(t, svc, inst.Id, 200)
239-
assert.Contains(t, logs, "overlay-init: app exited with code", "App should have exited")
239+
assert.Contains(t, logs, "[exec] app exited with code", "App should have exited")
240240

241241
// Test exec commands work even though the main app (bash) has exited
242242
dialer2, err := hypervisor.NewVsockDialer(actualInst.HypervisorType, actualInst.VsockSocket, actualInst.VsockCID)

lib/system/init/mode_exec.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,11 @@ func runExecMode(log *Logger, cfg *Config) {
5959

6060
log.Info("exec", "launching entrypoint")
6161

62-
// Run the entrypoint
62+
// Run the entrypoint without stdin (defaults to /dev/null).
63+
// This matches the old shell script behavior where the app ran in background with &
64+
// and couldn't read from stdin. Interactive shells like bash will see EOF and exit.
65+
// Users interact with the VM via guest-agent exec, not the entrypoint's stdin.
6366
appCmd := exec.Command("/bin/sh", "-c", shellCmd)
64-
appCmd.Stdin = os.Stdin
6567
appCmd.Stdout = os.Stdout
6668
appCmd.Stderr = os.Stderr
6769

0 commit comments

Comments
 (0)