Skip to content
Permalink
Browse files

osx: Fix for JENKINS-12622 - opening browser too early

Originally-From: jenkins-ci.org/commit/core/eae3e3d284cb41b4366f7fcd0d29fe104083d426
  • Loading branch information
stisti committed Feb 2, 2012
1 parent f9101fc commit 1619b2faa2828ae829ec436dd1a5c3b1f44caf83
Showing with 24 additions and 0 deletions.
  1. +12 −0 scripts/postinstall-launchd
  2. +12 −0 scripts/postinstall-launchd-jenkins
@@ -10,3 +10,15 @@ find /Users/Shared/Jenkins \( -not -user daemon -or -not -group daemon \) -print

# Load and start the launch daemon
/bin/launchctl load -w ${JENKINS_PLIST}

# Wait for port 8080 to start accepting connections.
# But don't wait forever.
timeout=$(($(date +%s) + 60))
while [ $(date +%s) -lt $timeout ] && ! curl -s http://localhost:8080 >/dev/null; do
sleep 1
done

if [ $(date +%s) -ge $timeout ]; then
echo "Timed out waiting for Jenkins port 8080 to start listening!"
echo "Either Jenkins did not load or this system is very slow."
fi
@@ -42,3 +42,15 @@ find "$JENKINS_HOMEDIR" \( -not -user jenkins -or -not -group jenkins \) -print0

# Load and start the launch daemon
/bin/launchctl load -w ${JENKINS_PLIST}

# Wait for port 8080 to start accepting connections.
# But don't wait forever.
timeout=$(($(date +%s) + 60))
while [ $(date +%s) -lt $timeout ] && ! curl -s http://localhost:8080 >/dev/null; do
sleep 1
done

if [ $(date +%s) -ge $timeout ]; then
echo "Timed out waiting for Jenkins port 8080 to start listening!"
echo "Either Jenkins did not load or this system is very slow."
fi

0 comments on commit 1619b2f

Please sign in to comment.
You can’t perform that action at this time.