Created
November 12, 2021 07:03
-
-
Save luochen1990/f0580df615a69b2f888e0e8320d23bde to your computer and use it in GitHub Desktop.
带多个daemon进程的测试脚本的写作模板
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
#!/usr/bin/env bash | |
#So that directories are relative to current file path instead of cwd | |
#Ref: https://stackoverflow.com/questions/242538/unix-shell-script-find-out-which-directory-the-script-file-resides | |
cd $(dirname $0) | |
cd ./server | |
#Start multiple daemon processes and kill them all in one shot | |
#Ref: https://stackoverflow.com/questions/3004811/how-do-you-run-multiple-programs-in-parallel-from-a-bash-script | |
(trap 'kill 0' SIGINT EXIT; | |
./sdk/gateway & | |
./sdk/nameserv --server-id ns1 & | |
./src/main.py & | |
sleep 3 && ../client/src/main.py | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment