diff options
| author | James O'Doherty <james@theodohertyfamily.com> | 2026-05-22 10:14:03 -0400 |
|---|---|---|
| committer | James O'Doherty <james@theodohertyfamily.com> | 2026-05-22 10:14:03 -0400 |
| commit | 5dbc46f3c1c75bf922bcc1c3df342323c23c04ce (patch) | |
| tree | 1a2840366e5d39aa3d9e8d868dd5893f5c488373 /internal/namespace | |
| parent | 764d3e67fc783c487f42d398d1b85a5a1f0d8ef0 (diff) | |
docs: update README and AGENTS.md to reflect embedded launcher architecture
Diffstat (limited to 'internal/namespace')
| -rw-r--r-- | internal/namespace/launcher_src/launcher.c | 11 | ||||
| -rw-r--r-- | internal/namespace/namespace.go | 5 |
2 files changed, 7 insertions, 9 deletions
diff --git a/internal/namespace/launcher_src/launcher.c b/internal/namespace/launcher_src/launcher.c index 70737e4..63dd6ff 100644 --- a/internal/namespace/launcher_src/launcher.c +++ b/internal/namespace/launcher_src/launcher.c @@ -69,9 +69,12 @@ int main(int argc, char **argv) { return 1; } - fprintf(stderr, "[launcher] Executing binary: %s\n", argv[0]); - execvp(argv[0], argv); + // Use execv instead of execvp to avoid PATH search issues + // since we are providing an absolute path from Go. + if (execv(argv[0], argv) == -1) { + perror("execv failed"); + return 1; + } - perror("execvp"); - return 1; + return 0; } diff --git a/internal/namespace/namespace.go b/internal/namespace/namespace.go index 98d73b6..5e31b9d 100644 --- a/internal/namespace/namespace.go +++ b/internal/namespace/namespace.go @@ -84,14 +84,9 @@ func Bootstrap() error { // 3. Prepare arguments for the launcher. // The launcher expects: launcher <command_to_run> [args...] - // syscall.Exec's second argument is the argv array. - // argv[0] is set by the kernel to the launcherPath. - // So our first slice element becomes argv[1]. args := []string{self} args = append(args, os.Args[1:]...) - fmt.Printf("[bootstrap] Execing launcher with args: %v\n", args) - // 4. Replace the current process with the launcher. err = syscall.Exec(launcherPath, args, os.Environ()) if err != nil { |
