[init] bail out in case the db access fails (#123)

* [init] bail out in case the db access fails

Signed-off-by: Jakob Ackermann <das7pad@outlook.com>

* [misc] bail out in case any command in an init_script failed

NOTE: sh does not support `-o pipefail`.

Signed-off-by: Jakob Ackermann <das7pad@outlook.com>
This commit is contained in:
Jakob Ackermann 2020-02-13 13:33:56 +01:00 committed by GitHub
parent 47e51a2075
commit e83b7856c3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 3 deletions

View file

@ -1,4 +1,6 @@
#!/bin/sh
set -e
mkdir -p /var/lib/sharelatex/data
chown www-data:www-data /var/lib/sharelatex/data

View file

@ -1,4 +1,5 @@
#!/bin/sh
#!/bin/bash
set -e -o pipefail
# generate secrets and defines them as environment variables
# https://github.com/phusion/baseimage-docker#centrally-defining-your-own-environment-variables

View file

@ -1,3 +1,5 @@
#!/bin/sh
#!/bin/bash
set -e -o pipefail
# See the bottom of http://stackoverflow.com/questions/24319662/from-inside-of-a-docker-container-how-do-i-connect-to-the-localhost-of-the-mach
echo "`route -n | awk '/UG[ \t]/{print $2}'` dockerhost" >> /etc/hosts
echo "`route -n | awk '/UG[ \t]/{print $2}'` dockerhost" >> /etc/hosts

View file

@ -1,4 +1,6 @@
#!/bin/sh
set -e
echo "Checking can connect to mongo and redis"
cd /var/www/sharelatex && grunt check:redis
cd /var/www/sharelatex && grunt check:mongo

View file

@ -1,4 +1,6 @@
#!/bin/sh
set -e
which node
which grunt
ls -al /var/www/sharelatex/migrations