From da4784d0cabbb277eb5764bdcccba28aa7145324 Mon Sep 17 00:00:00 2001 From: Pedro Algarvio Date: Sun, 17 Mar 2013 11:54:55 +0000 Subject: [PATCH] Try to get more information out of the system when the daemons are not found running. --- bootstrap-salt.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/bootstrap-salt.sh b/bootstrap-salt.sh index 1b90513..fc7ce8e 100755 --- a/bootstrap-salt.sh +++ b/bootstrap-salt.sh @@ -2270,9 +2270,13 @@ if [ "$DAEMONS_RUNNING_FUNC" != "null" ]; then if [ $? -ne 0 ]; then echoerror "Failed to run ${DAEMONS_RUNNING_FUNC}()!!!" echodebug "Running Processes:" - for line in "$(ps auxwww)"; do + OIFS=$IFS; + IFS=$'\n'; + RUNNING_PROCESSES=$(ps auxwww) + for line in $RUNNING_PROCESSES; do echodebug "$line" done + IFS=$OIFS for fname in minion master syndic; do # Skip if not meant to be installed @@ -2280,9 +2284,15 @@ if [ "$DAEMONS_RUNNING_FUNC" != "null" ]; then [ $fname = "master" ] && [ $INSTALL_MASTER -eq $BS_FALSE ] && continue [ $fname = "syndic" ] && [ $INSTALL_SYNDIC -eq $BS_FALSE ] && continue - [ ! -f /var/log/salt/$fname ] && continue + [ ! $SALT_ETC_DIR/$fname ] && [ $fname != "syndic" ] && echodebug "$SALT_ETC_DIR/$fname does not exist" - echodebug "DEAMON LOGS for $fname: $(cat /var/log/salt/$fname)" + [ ! -f /var/log/salt/$fname ] && echodebug "/var/log/salt/$fname does not exist. Can't cat its contents!" && continue + + echodebug "DEAMON LOGS for $fname:" + while IFS=$'\n' read -r line; do + echodebug "$line" + done < /var/log/salt/$fname + echo done exit 1