reexec: Use in-memory binary on linux instead of os.Args[0]
This keeps reexec working properly even if the on-disk binary was replaced. Signed-off-by: Tibor Vass <tibor@docker.com>
This commit is contained in:
parent
0cec613de9
commit
264e16318f
3 changed files with 15 additions and 4 deletions
|
@ -6,6 +6,12 @@ import (
|
|||
"os/exec"
|
||||
)
|
||||
|
||||
// Self returns the path to the current process's binary.
|
||||
// Uses os.Args[0].
|
||||
func Self() string {
|
||||
return naiveSelf()
|
||||
}
|
||||
|
||||
// Command returns *exec.Cmd which have Path as current binary.
|
||||
// For example if current binary is "docker.exe" at "C:\", then cmd.Path will
|
||||
// be set to "C:\docker.exe".
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue