Skip to content

The file handle of the parent process will be leaked to the child process #112

@today2014

Description

@today2014

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions