Created
December 5, 2013 23:09
-
-
Save bradhe/7815715 to your computer and use it in GitHub Desktop.
Shell script for testing how long it takes for Foreman + Unicorn to come online during start up.
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
| #!/bin/bash | |
| # Start a new foreman. We'll need the PID for later. | |
| foreman start redis=1,web=1 & | |
| FOREMAN_PID=$! | |
| while : | |
| do | |
| curl http://localhost:5000/login &> /dev/null | |
| if [ $? -eq 0 ]; then | |
| break | |
| fi | |
| done | |
| sudo kill $FOREMAN_PID | |
| sudo kill -s TERM $FOREMAN_PID | |
| sudo kill -s KILL $FOREMAN_PID | |
| # because fuck foreman, that's why. | |
| ps waxu | grep [u]nicorn | awk '{print $2}' | xargs sudo kill |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment