Last active
April 1, 2020 21:40
-
-
Save sqqqrly/0cd3b29a99bd7bfe4c39767382d6415f to your computer and use it in GitHub Desktop.
Trapping signals / awk, without leaning toothpicks
This file contains 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 | |
function shutdown { | |
echo "Shutting down $PROGRAM" | |
local -r QUIT="SIGQUIT" | |
# TODO - What is the process is not found? | |
local -r PID="$(ps aux | awk '( $0 ~ "/usr/bin/clickhouse-server" ) {print $2}')" | |
echo "pid: $PID" | |
#kill -s 3 "$PID" | |
echo "Done killing" | |
} | |
trap shutdown EXIT | |
echo "sleeping..." | |
sleep 3600 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment