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
|
@ -30,8 +30,7 @@ func Init() bool {
|
|||
return false
|
||||
}
|
||||
|
||||
// Self returns the path to the current processes binary
|
||||
func Self() string {
|
||||
func naiveSelf() string {
|
||||
name := os.Args[0]
|
||||
if filepath.Base(name) == name {
|
||||
if lp, err := exec.LookPath(name); err == nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue