summaryrefslogtreecommitdiffstats
path: root/lava-master/scripts/start.sh
diff options
context:
space:
mode:
authorTyler Baker <forcedinductionz@gmail.com>2017-10-25 08:13:48 -0700
committerGitHub <noreply@github.com>2017-10-25 08:13:48 -0700
commitceb64a544ae771e2e1d1a41e46a59c6f0a9de060 (patch)
tree0e3aac8edbfd28384469190795fab4e9d07cb9ec /lava-master/scripts/start.sh
parentee8ef7b266fe45f2f2bc3ea6a8759e012b021e40 (diff)
parent26cc005179760bd25b8bdd724a936847c81d24eb (diff)
Merge pull request #9 from montjoie/dockercompose
Dockercompose
Diffstat (limited to 'lava-master/scripts/start.sh')
-rwxr-xr-xlava-master/scripts/start.sh37
1 files changed, 37 insertions, 0 deletions
diff --git a/lava-master/scripts/start.sh b/lava-master/scripts/start.sh
new file mode 100755
index 0000000..f4cc4eb
--- /dev/null
+++ b/lava-master/scripts/start.sh
@@ -0,0 +1,37 @@
+#!/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
+
+start postgresql
+start apache2
+start lava-server
+start lava-master
+start lava-coordinator
+start lava-slave
+start lava-server-gunicorn
+start tftpd-hpa
+
+postgres-ready
+service apache2 reload #added after the website not running a few times on boot