use github.com/go-cmd/cmd I wrote a daemon process
Start my own program run linux, the code is as follows:
cmdx.SetConfig(cmdx.Config{CommandDir: “/app/mysvr/bin”)
if err := cmdx.RunCommandPrintOutput("./mysvr", "-d"); err != nil {
log.Fatalf("Command failed: %v", err)
}
My daemon process uses file locks to prevent multiple instances from running,the my daemon has exited. After the mysvr daemon runs in the background, the file handle of the daemon's file lock leaks into mysvr.
Could you please advise on any good solutions?