From 4a4ae9b3e459b9a83fd3293c69d77573c937df7e Mon Sep 17 00:00:00 2001 From: Zoe Lee Date: Sun, 15 Feb 2026 11:29:25 +0800 Subject: [PATCH 1/2] fix(cmd/start): use absolute executable path for child process --- cmd/start.go | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/cmd/start.go b/cmd/start.go index 57edff38c..b98756178 100644 --- a/cmd/start.go +++ b/cmd/start.go @@ -31,14 +31,23 @@ func start() { return } } - args := os.Args - args[1] = "server" - args = append(args, "--force-bin-dir") - cmd := &exec.Cmd{ - Path: args[0], - Args: args, - Env: os.Environ(), + exe, err := os.Executable() + if err != nil { + log.Fatal("failed to resolve executable path: ", err) + } + childArgs := append([]string{"server"}, os.Args[2:]...) + hasForceBinDir := false + for _, arg := range childArgs { + if arg == "--force-bin-dir" { + hasForceBinDir = true + break + } + } + if !hasForceBinDir { + childArgs = append(childArgs, "--force-bin-dir") } + cmd := exec.Command(exe, childArgs...) + cmd.Env = os.Environ() stdout, err := os.OpenFile(filepath.Join(filepath.Dir(pidFile), "start.log"), os.O_WRONLY|os.O_APPEND|os.O_CREATE, 0666) if err != nil { log.Fatal(os.Getpid(), ": failed to open start log file:", err) From abe573779ae1ba4aabe664b9ba9388b76a294ae1 Mon Sep 17 00:00:00 2001 From: Zoe Lee Date: Fri, 20 Feb 2026 14:09:33 +0800 Subject: [PATCH 2/2] fix(cmd/start): detect force-bin-dir flag variants --- cmd/start.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/start.go b/cmd/start.go index b98756178..a1838eadd 100644 --- a/cmd/start.go +++ b/cmd/start.go @@ -8,6 +8,7 @@ import ( "os/exec" "path/filepath" "strconv" + "strings" log "github.com/sirupsen/logrus" "github.com/spf13/cobra" @@ -38,7 +39,7 @@ func start() { childArgs := append([]string{"server"}, os.Args[2:]...) hasForceBinDir := false for _, arg := range childArgs { - if arg == "--force-bin-dir" { + if arg == "--force-bin-dir" || strings.HasPrefix(arg, "--force-bin-dir=") { hasForceBinDir = true break }