github.com/tiagovtristao/plz@v13.4.0+incompatible/src/core/exec_linux.go (about)

     1  // +build linux
     2  
     3  package core
     4  
     5  import (
     6  	"os/exec"
     7  	"syscall"
     8  )
     9  
    10  // ExecCommand executes an external command.
    11  // We set Pdeathsig to try to make sure commands don't outlive us if we die.
    12  func ExecCommand(command string, args ...string) *exec.Cmd {
    13  	cmd := exec.Command(command, args...)
    14  	cmd.SysProcAttr = &syscall.SysProcAttr{
    15  		Pdeathsig: syscall.SIGHUP,
    16  	}
    17  	return cmd
    18  }