Skip to content

Commit 3223844

Browse files
committed
add pkg/chrootarchive and use it on the daemon
Docker-DCO-1.1-Signed-off-by: Cristian Staretu <[email protected]> (github: unclejack) Conflicts: builder/internals.go daemon/graphdriver/aufs/aufs.go daemon/volumes.go fixed conflicts in imports
1 parent 9a9b50f commit 3223844

3 files changed

Lines changed: 29 additions & 3 deletions

File tree

reexec/command_linux.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// +build linux
2+
3+
package reexec
4+
5+
import (
6+
"os/exec"
7+
"syscall"
8+
)
9+
10+
func Command(args ...string) *exec.Cmd {
11+
return &exec.Cmd{
12+
Path: Self(),
13+
Args: args,
14+
SysProcAttr: &syscall.SysProcAttr{
15+
Pdeathsig: syscall.SIGTERM,
16+
},
17+
}
18+
}

reexec/command_unsupported.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// +build !linux
2+
3+
package reexec
4+
5+
import (
6+
"os/exec"
7+
)
8+
9+
func Command(args ...string) *exec.Cmd {
10+
return nil
11+
}

reexec/reexec.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,16 @@ func Init() bool {
2727

2828
return true
2929
}
30-
3130
return false
3231
}
3332

3433
// Self returns the path to the current processes binary
3534
func Self() string {
3635
name := os.Args[0]
37-
3836
if filepath.Base(name) == name {
3937
if lp, err := exec.LookPath(name); err == nil {
4038
name = lp
4139
}
4240
}
43-
4441
return name
4542
}

0 commit comments

Comments
 (0)