summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lava-master/Dockerfile7
-rw-r--r--lava-master/apache2/.empty0
-rw-r--r--lava-master/configs/tftpd-hpa6
-rwxr-xr-xlava-master/scripts/start.sh38
-rwxr-xr-xlavalab-gen.py4
5 files changed, 44 insertions, 11 deletions
diff --git a/lava-master/Dockerfile b/lava-master/Dockerfile
index b018a2d..80da8fb 100644
--- a/lava-master/Dockerfile
+++ b/lava-master/Dockerfile
@@ -2,8 +2,6 @@ FROM baylibre/lava-master-base:2019.03_stretch
COPY backup /root/backup/
-COPY configs/tftpd-hpa /etc/default/tftpd-hpa
-
COPY default/* /etc/default/
RUN git clone https://github.com/BayLibre/lava-healthchecks.git
@@ -18,6 +16,7 @@ COPY users/ /root/lava-users/
COPY groups/ /root/lava-groups/
COPY tokens/ /root/lava-callback-tokens/
COPY scripts/setup.sh /
+COPY scripts/start.sh /
COPY settings.conf /etc/lava-server/
@@ -35,6 +34,8 @@ COPY lava_http_fqdn /root/
COPY env/ /etc/lava-server/dispatcher.d/
-EXPOSE 69/udp 80 3079 5555 5556
+COPY apache2/ /etc/apache2/
+
+EXPOSE 3079 5555 5556
CMD /start.sh && while [ true ];do sleep 365d; done
diff --git a/lava-master/apache2/.empty b/lava-master/apache2/.empty
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/lava-master/apache2/.empty
diff --git a/lava-master/configs/tftpd-hpa b/lava-master/configs/tftpd-hpa
deleted file mode 100644
index bb6f079..0000000
--- a/lava-master/configs/tftpd-hpa
+++ /dev/null
@@ -1,6 +0,0 @@
-# /etc/default/tftpd-hpa
-
-TFTP_USERNAME="tftp"
-TFTP_DIRECTORY="/var/lib/lava/dispatcher/tmp/"
-TFTP_ADDRESS="0.0.0.0:69"
-TFTP_OPTIONS="--secure"
diff --git a/lava-master/scripts/start.sh b/lava-master/scripts/start.sh
new file mode 100755
index 0000000..ce94c39
--- /dev/null
+++ b/lava-master/scripts/start.sh
@@ -0,0 +1,38 @@
+#!/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-server-gunicorn || exit $?
+
+postgres-ready
+service apache2 reload #added after the website not running a few times on boot
diff --git a/lavalab-gen.py b/lavalab-gen.py
index 0e8c018..b3f096a 100755
--- a/lavalab-gen.py
+++ b/lavalab-gen.py
@@ -573,7 +573,7 @@ def main():
if (use_conmux and use_ser2net) or (use_conmux and use_screen) or (use_screen and use_ser2net):
print("ERROR: Only one uart handler must be configured")
sys.exit(1)
- if not use_conmux and not use_screen and not use_ser2net:
+ if not use_conmux and not use_screen and not use_ser2net and not "connection_command" in board:
use_ser2net = True
if use_conmux:
conmuxline = template_conmux.substitute(board=board_name, baud=baud)
@@ -601,7 +601,7 @@ def main():
fp = open("%s/lava-screen.conf" % workerdir, "a")
fp.write("%s\n" % board_name)
fp.close()
- elif "connection_command" in board:
+ if "connection_command" in board:
connection_command = board["connection_command"]
device_line += template_device_connection_command.substitute(connection_command=connection_command)
if "uboot_ipaddr" in board: