From a5565ac212ee3dd88777a022b318e8d1c46211cb Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Fri, 24 Jul 2020 19:52:19 +0000 Subject: [PATCH] Made the docker container syslog start less noisy. Refined the virtualenv requirements installation to test for an existing django properly, and use the repository requirements file if available. - Legacy-Id: 18258 --- docker/docker-init.sh | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/docker/docker-init.sh b/docker/docker-init.sh index f0e92f802..73b87cb51 100644 --- a/docker/docker-init.sh +++ b/docker/docker-init.sh @@ -38,9 +38,9 @@ if ! /etc/init.d/mysql status; then /etc/init.d/mysql start fi -echo "Checking if syslog is running ..." -if ! /etc/init.d/rsyslog status; then - echo "Starting syslog ..." +echo "Checking if syslogd is running ..." +if ! /etc/init.d/rsyslog status > /dev/null; then + echo "Starting syslogd ..." /etc/init.d/rsyslog start fi @@ -106,12 +106,20 @@ fi echo "Activating the virtual python environment ..." . $VIRTDIR/bin/activate -if ! python -c "import django"; then + +if ! $VIRTDIR/bin/python -c "import django"; then echo "Installing requirements ..." - pip install -r /usr/local/share/datatracker/requirements.txt + if [ ! -f /home/$USER/$CWD/requirements.txt ]; then + echo " Using /home/$USER/$CWD/requirements.txt" + pip install -r /home/$USER/$CWD/requirements.txt + else + echo " Didn't find /home/$USER/$CWD/requirements.txt" + echo " Using /usr/local/share/datatracker/requirements.txt" + pip install -r /usr/local/share/datatracker/requirements.txt + fi fi -if [ ! -f $CWD/ietf/settings_local.py ]; then +if [ ! -f /home/$USER/$CWD/ietf/settings_local.py ]; then echo "Setting up a default settings_local.py ..." cp /home/$USER/$CWD/docker/settings_local.py /home/$USER/$CWD/ietf/settings_local.py fi