procattr_linux.go raw

   1  package tor
   2  
   3  import "syscall"
   4  
   5  // sysProcAttr returns platform-specific process attributes for the Tor subprocess.
   6  // On Linux, Pdeathsig ensures the kernel sends SIGKILL to the Tor process
   7  // when its parent dies, preventing orphaned Tor processes.
   8  func sysProcAttr() *syscall.SysProcAttr {
   9  	return &syscall.SysProcAttr{
  10  		Pdeathsig: syscall.SIGKILL,
  11  	}
  12  }
  13