2 Star 7 Fork 7

Bomy / docker

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
command_linux.go 693 Bytes
一键复制 编辑 原始数据 按行查看 历史
Daniel Nephin 提交于 2018-02-05 16:05 . Add canonical import comment
package reexec // import "github.com/docker/docker/pkg/reexec"
import (
"os/exec"
"syscall"
"golang.org/x/sys/unix"
)
// Self returns the path to the current process's binary.
// Returns "/proc/self/exe".
func Self() string {
return "/proc/self/exe"
}
// Command returns *exec.Cmd which has Path as current binary. Also it setting
// SysProcAttr.Pdeathsig to SIGTERM.
// This will use the in-memory version (/proc/self/exe) of the current binary,
// it is thus safe to delete or replace the on-disk binary (os.Args[0]).
func Command(args ...string) *exec.Cmd {
return &exec.Cmd{
Path: Self(),
Args: args,
SysProcAttr: &syscall.SysProcAttr{
Pdeathsig: unix.SIGTERM,
},
}
}
1
https://gitee.com/Bomy/docker.git
git@gitee.com:Bomy/docker.git
Bomy
docker
docker
d912e9460e28

搜索帮助