forked from solana-labs/solana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move cleanup to a script so it doesn't kill itself (solana-labs#7603)
- Loading branch information
Showing
2 changed files
with
37 additions
and
25 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -x | ||
! tmux list-sessions || tmux kill-session | ||
declare sudo= | ||
if sudo true; then | ||
sudo="sudo -n" | ||
fi | ||
|
||
echo "pwd: $(pwd)" | ||
for pid in solana/*.pid; do | ||
pgid=$(ps opgid= "$(cat "$pid")" | tr -d '[:space:]') | ||
if [[ -n $pgid ]]; then | ||
$sudo kill -- -"$pgid" | ||
fi | ||
done | ||
if [[ -f solana/netem.cfg ]]; then | ||
solana/scripts/netem.sh delete < solana/netem.cfg | ||
rm -f solana/netem.cfg | ||
fi | ||
solana/scripts/net-shaper.sh force_cleanup | ||
for pattern in validator.sh boostrap-leader.sh solana- remote- iftop validator client node; do | ||
echo "killing $pattern" | ||
pkill -f $pattern | ||
done |