summaryrefslogtreecommitdiffstats
path: root/lava-master-base/scripts/start.sh
diff options
context:
space:
mode:
authorkhilman <khilman@users.noreply.github.com>2018-07-27 08:18:39 -0500
committerGitHub <noreply@github.com>2018-07-27 08:18:39 -0500
commitd733f2d4280959fed968d1589580f46460ecba27 (patch)
treeb91d7de9ed99bf3430854198f1dbc7c2dbfefafb /lava-master-base/scripts/start.sh
parentbaf680990ecb539cde0a16ef5b32a7321dd4538a (diff)
parentfd42a55a19f6fa32efb5893f5fb43f86de9b3e2d (diff)
Merge pull request #34 from montjoie/splitimage
Splitimage
Diffstat (limited to 'lava-master-base/scripts/start.sh')
-rwxr-xr-xlava-master-base/scripts/start.sh40
1 files changed, 40 insertions, 0 deletions
diff --git a/lava-master-base/scripts/start.sh b/lava-master-base/scripts/start.sh
new file mode 100755
index 0000000..c34fe34
--- /dev/null
+++ b/lava-master-base/scripts/start.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+
+postgres-ready () {
+ echo "Waiting for lavaserver database to be active"
+ while (( $(ps -ef | grep -v grep | grep postgres | grep lavaserver | wc -l) == 0 ))
+ do
+ echo -n "."
+ sleep 1
+ done
+ echo
+ echo "[ ok ] LAVA server ready"
+}
+
+start () {
+ echo "Starting $1"
+ if (( $(ps -ef | grep -v grep | grep -v add_device | grep -v dispatcher-config | grep "$1" | wc -l) > 0 ))
+ then
+ echo "$1 appears to be running"
+ else
+ service "$1" start
+ fi
+}
+
+#remove lava-pid files incase the image is stored without first stopping the services
+rm -f /var/run/lava-*.pid 2> /dev/null
+
+/etc/init.d/postgresql start
+
+/setup.sh || exit $?
+
+start apache2 || exit $?
+start lava-logs || exit $?
+start lava-master || exit $?
+start lava-coordinator || exit $?
+start lava-slave || exit $?
+start lava-server-gunicorn || exit $?
+start tftpd-hpa || exit $?
+
+postgres-ready
+service apache2 reload #added after the website not running a few times on boot