pkg/reexec/command_linux.go
Alexander Morozov 0340c8548a Add docstring to reexec.Command
Signed-off-by: Alexander Morozov <lk4d4@docker.com>
2015-07-20 17:00:18 -07:00

22 lines
463 B
Go

// +build linux
package reexec
import (
"os/exec"
"syscall"
)
// Command returns *exec.Cmd which have Path as current binary. Also it setting
// SysProcAttr.Pdeathsig to SIGTERM.
// For example if current binary is "docker" at "/usr/bin", then cmd.Path will
// be set to "/usr/bin/docker".
func Command(args ...string) *exec.Cmd {
return &exec.Cmd{
Path: Self(),
Args: args,
SysProcAttr: &syscall.SysProcAttr{
Pdeathsig: syscall.SIGTERM,
},
}
}