From 07506f1f53bca612238bbb08d3fde85bf98d3383 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Thu, 31 Dec 2015 08:19:39 -0500 Subject: [PATCH 1/4] Adding more info output to bootstrap script run This allows us to better keep track of what commands are being run and when. --- bootstrap.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bootstrap.sh b/bootstrap.sh index 5b9c6ec3a..7587a2a6e 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -29,6 +29,7 @@ hostname -f > /dev/null 2>&1 || { exit 1 } +echo "--> Ensuring we have the proper dependencies" apt-get update -qq > /dev/null [[ $(lsb_release -sr) == "12.04" ]] && apt-get install -qq -y python-software-properties @@ -90,6 +91,7 @@ elif [[ -n $DOKKU_TAG ]]; then elif [[ "$major" -eq "0" ]] && [[ "$minor" -ge "4" ]] && [[ "$patch" -ge "0" ]]; then export DOKKU_CHECKOUT="$DOKKU_SEMVER" dokku_install_package + echo "--> Running post-install dependency installation" sudo -E dokku plugin:install-dependencies --core else export DOKKU_CHECKOUT="$DOKKU_TAG" @@ -97,6 +99,7 @@ elif [[ -n $DOKKU_TAG ]]; then fi else dokku_install_package + echo "--> Running post-install dependency installation" sudo -E dokku plugin:install-dependencies --core fi From 908f551e0fc67bed95d8b38f81f1a1f83dad09b5 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Thu, 31 Dec 2015 08:22:06 -0500 Subject: [PATCH 2/4] Enable debugging support to debian postinst hook It is now possible to turn on debugging during an apt-get run by using `TRACE=1` --- debian/postinst | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/debian/postinst b/debian/postinst index eea2fedd2..eca64e275 100755 --- a/debian/postinst +++ b/debian/postinst @@ -1,5 +1,5 @@ -#!/bin/sh -set -e +#!/bin/bash +set -eo pipefail; [[ $TRACE ]] && set -x . /usr/share/debconf/confmodule @@ -18,13 +18,13 @@ case "$1" in egrep -i "^docker" /etc/group || groupadd docker usermod -aG docker dokku - # setup plugin directories + echo "setup plugin directories" # should be replaced by `plugn init` mkdir -p ${DOKKU_LIB_ROOT}/core-plugins/available ${DOKKU_LIB_ROOT}/plugins/available mkdir -p ${DOKKU_LIB_ROOT}/core-plugins/enabled ${DOKKU_LIB_ROOT}/plugins/enabled touch ${DOKKU_LIB_ROOT}/core-plugins/config.toml ${DOKKU_LIB_ROOT}/plugins/config.toml - # migrate old plugins + echo "migrate old plugins" find ${DOKKU_LIB_ROOT}/plugins/ -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read -r plugin; do if [ "$plugin" = "available" ] || [ "$plugin" = "enabled" ]; then continue @@ -35,7 +35,7 @@ case "$1" in fi done - # enable all core plugins + echo "enable all core plugins" find ${DOKKU_LIB_ROOT}/core-plugins/available -mindepth 1 -maxdepth 1 -type d -printf '%f\n' | while read -r plugin; do if [ ! -d ${DOKKU_LIB_ROOT}/plugins/available/$plugin ]; then ln -s ${DOKKU_LIB_ROOT}/core-plugins/available/$plugin ${DOKKU_LIB_ROOT}/plugins/available/$plugin; @@ -45,11 +45,13 @@ case "$1" in done chown dokku:dokku -R ${DOKKU_LIB_ROOT}/plugins ${DOKKU_LIB_ROOT}/core-plugins + echo "install all core plugins" dokku plugin:install --core rm -f ${DOKKU_ROOT}/VERSION cp ${DOKKU_LIB_ROOT}/STABLE_VERSION ${DOKKU_ROOT}/VERSION + echo "starting dokku-installer if necessary" if [ -f /etc/init/dokku-installer.conf ] && service dokku-installer status 2> /dev/null | grep waiting; then sudo service dokku-installer start fi From ae2b2febe9034d786e18f85ede9fc85b719f0c7c Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Thu, 31 Dec 2015 08:22:38 -0500 Subject: [PATCH 3/4] Enable debugging support to debian preinst hook It is now possible to turn on debugging during an apt-get run by using `TRACE=1` --- debian/preinst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/preinst b/debian/preinst index 2f214d472..65f04f69c 100755 --- a/debian/preinst +++ b/debian/preinst @@ -1,5 +1,5 @@ -#!/bin/sh -set -e +#!/bin/bash +set -eo pipefail; [[ $TRACE ]] && set -x . /usr/share/debconf/confmodule From 94b2a6a014835cc22dfa166c2d81e109904e0910 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Thu, 31 Dec 2015 08:54:02 -0500 Subject: [PATCH 4/4] Invoke db_stop to ensure underlying services close open file descriptors --- debian/postinst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/debian/postinst b/debian/postinst index eca64e275..1b1793b8d 100755 --- a/debian/postinst +++ b/debian/postinst @@ -58,6 +58,7 @@ case "$1" in db_get "dokku/web_config" if [ "$RET" = "true" ]; then + db_stop exit 0 fi @@ -86,4 +87,5 @@ case "$1" in ;; esac +db_stop exit 0