This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func main() { | |
running := true | |
// Make a channel the signal handler will subscribe | |
sigc := make(chan os.Signal, 1) | |
// Notify will send a sigint or sigterm signal to the | |
// the previously created channel `sigc` | |
signal.Notify(sigc, syscall.SIGINT, syscall.SIGTERM) | |
go func() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
declare -a JOBS | |
JOBS=("sleep 1" "sleep 2" "sleep 3") | |
cleanup() { | |
trap "" SIGTERM | |
kill 0 | |
wait |
OlderNewer