git.sr.ht/~pingoo/stdx@v0.0.0-20240218134121-094174641f6e/tools/watchgod/process_posix.go (about)

     1  //go:build darwin || dragonfly || freebsd || linux || nacl || netbsd || openbsd || solaris
     2  // +build darwin dragonfly freebsd linux nacl netbsd openbsd solaris
     3  
     4  package main
     5  
     6  import (
     7  	"os"
     8  	"syscall"
     9  )
    10  
    11  var fatalSignals = []os.Signal{
    12  	syscall.SIGINT,
    13  	syscall.SIGTERM,
    14  	syscall.SIGQUIT,
    15  }
    16  
    17  func terminateGracefully(process *os.Process) error {
    18  	return process.Signal(syscall.SIGTERM)
    19  }
    20  
    21  func gracefulTerminationPossible() bool {
    22  	return true
    23  }