10年ほど前にメッチャ MySQL で TPC-C を回していたときに使っていた方法です。
echo -n "Waiting for the database ready...." while true; do sleep 1 mysql -h ${TPCC_HOST} -P ${TPCC_PORT} -u ${TPCC_USER} --password=${TPCC_PASSWORD} \ -e 'show status' 1> /dev/null 2> /dev/null && break
echo -n '.' done echo 'up'
MySQLクライアントでサーバに接続し適当なクエリを実行できるかでアクセス性があるか判断しています。このクエリが実行できるようになるまでここでブロックし、問題なくクエリが実行できれば終了コードとして 0 が返されますので && break が実行されループを抜けます。
今回はサーバがクエリを受け付けられるようになるまで待っていますが、同じ方法を用いて、クエリが実行できるかどうかで処理内容を条件分けすることもできますね。
mysql -h ${TPCC_HOST} -P ${TPCC_PORT} -u ${TPCC_USER} --password=${TPCC_PASSWORD} \ -e 'show status' 1> /dev/null 2> /dev/null # 上記 mysql コマンドの終了コードが格納された $? を見て処理を分岐する if [ $? -eq 0 ]; then echo "クエリが成功した" else echo "サーバに接続できなかった、クエリが失敗した" exit 1 # ゼロ以外の値でシェルスクリプトを異常終了させる fi exit 0 # 正常終了
Hence, that offers gamers entry to sellers and Roulette tables with all the action streaming live. The on line casino offers a $350 double deposit bonus and offers excellent customer help 24/7. Online roulette video games had been the prime factor we seemed for when selecting our sites. We seemed for roulette variants, live supplier 메리트카지노 video games, as well as|in addition to} the standard of the gameplay. Additionally, we considered what software suppliers a on line casino website options. Other than that, it doesn’t supply as many table video games as variety of the} different prime on-line casinos.
返信削除