Files
chia-blockchain/scripts/common.sh
T
Mariano SorgenteandGitHub 5468c25a09 Db headers, locks, pos dirs, and config (#88)
* New database table to store headers
* Loading blockchain only loads headers into memory instead of header blocks (header + proofs), speeds up the startup, and reduces normal operation memory usage by 80%
* Fix deadlock issues with store class
* Make memory store access synchronous, to reduce use of locks, this improves performance of block and unfinished block processing
* Remove locks from reads of DB, only lock for writes
* Cleaner configuration system with argparse
* Log to file by default, configurable to stdout
* Proof of space binary and create_plots scripts allow passing in temp and final directories
2020-02-05 09:42:57 +09:00

27 lines
419 B
Bash
Executable File

_kill_servers() {
PROCS=`ps -e | grep -E 'chia_|vdf_server' | awk '!/grep/' | awk '{print $1}'`
if [ -n "$PROCS" ]; then
echo "$PROCS" | xargs -L1 kill
fi
}
_kill_servers
BG_PIDS=""
_run_bg_cmd() {
"$@" &
BG_PIDS="$BG_PIDS $!"
}
_term() {
echo "Caught TERM or INT signal, killing all servers."
for PID in $BG_PIDS; do
kill -TERM "$PID"
done
_kill_servers
}
trap _term TERM
trap _term INT