summaryrefslogtreecommitdiffstats
path: root/lava-master/entrypoint.d
diff options
context:
space:
mode:
authorCorentin LABBE <clabbe@baylibre.com>2020-07-13 13:25:52 +0200
committerCorentin LABBE <clabbe@baylibre.com>2020-07-13 13:36:10 +0200
commit3fa641e74700acad323fe19f1eadb285aeb1dd66 (patch)
treecc13844c12d10cc63883f51d3d37390abe6960cb /lava-master/entrypoint.d
parent3860f1bb528503f6f2fb38d79d207d13498bc226 (diff)
Permit to set the postgres lavaserver password
By setting pg_lava_password, the final lavaserver password will be set to this value.
Diffstat (limited to 'lava-master/entrypoint.d')
-rwxr-xr-xlava-master/entrypoint.d/01_setup.sh7
1 files changed, 5 insertions, 2 deletions
diff --git a/lava-master/entrypoint.d/01_setup.sh b/lava-master/entrypoint.d/01_setup.sh
index 53db47e..95b180b 100755
--- a/lava-master/entrypoint.d/01_setup.sh
+++ b/lava-master/entrypoint.d/01_setup.sh
@@ -1,8 +1,11 @@
#!/bin/bash
# always reset the lavaserver user, since its password could have been reseted in a "docker build --nocache"
-if [ ! -e /root/pg_lava_password ];then
- < /dev/urandom tr -dc A-Za-z0-9 | head -c16 > /root/pg_lava_password
+if [ ! -s /root/pg_lava_password ];then
+ echo "DEBUG: Generating a random LAVA password"
+ < /dev/urandom tr -dc A-Za-z0-9 | head -c16 > /root/pg_lava_password
+else
+ echo "DEBUG: use the given LAVA password"
fi
sudo -u postgres psql -c "ALTER USER lavaserver WITH PASSWORD '$(cat /root/pg_lava_password)';" || exit $?
if [ -e /etc/lava-server/instance.conf ];then