Skip to content

Instantly share code, notes, and snippets.

@martende
Created May 19, 2016 09:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save martende/3ccca3a97cb650808d2b83c4630ed258 to your computer and use it in GitHub Desktop.
Save martende/3ccca3a97cb650808d2b83c4630ed258 to your computer and use it in GitHub Desktop.
Shell:
> go build test.go
> ./test &
> kill -HUP `pidof test`
> cat > ./test
bash: /home/user/test: Text file busy
import (
"os/signal"
"syscall"
"fmt"
)
func main() {
signal.Ignore(syscall.SIGHUP)
time.Sleep(1000 * time.Second)
fmt.Println("FINISHED")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment