Merge "Move openflowplugin Sonar scan to Sonarcloud"
[releng/builder.git] / jjb / packaging / start-odl.sh
1 #!/bin/bash
2
3 # Options:
4 #   -x: Echo commands
5 #   -e: Fail on errors
6 #   -o pipefail: Fail on errors in scripts this calls, give stacktrace
7 set -ex -o pipefail
8
9 # Start OpenDaylight
10 sudo systemctl start opendaylight
11
12 # Check systemd status of OpenDaylight, will fail if rc is nonzero
13 sudo systemctl status opendaylight
14
15 # Wait up to 60 seconds for ODL's Java process to start
16 for i in $(seq 20); do
17   # shellcheck disable=SC2015
18   pgrep java && break || sleep 3
19   echo "Waited $((i * 3)) seconds for ODL Java process to start"
20 done
21
22 # Verify Java process is running, will fail if rc is nonzero
23 pgrep java