diff --git a/divingbell/templates/bin/_apparmor.sh.tpl b/divingbell/templates/bin/_apparmor.sh.tpl index 768e9bd..0d4e4ed 100644 --- a/divingbell/templates/bin/_apparmor.sh.tpl +++ b/divingbell/templates/bin/_apparmor.sh.tpl @@ -121,15 +121,12 @@ for filename in ${!CURRENT_FILENAMES[@]}; do $load_cmd ${persist_path}/${filename} || die "Problem loading ${persist_path}/${filename}" done -exit 0 +log.INFO 'Putting the daemon to sleep.' EOF chmod 755 {{ .Values.conf.chroot_mnt_path | quote }}/tmp/apparmor_host.sh chroot {{ .Values.conf.chroot_mnt_path | quote }} /tmp/apparmor_host.sh -sleep 1 -echo 'INFO Putting the daemon to sleep.' - while [ 1 ]; do sleep 300 done diff --git a/divingbell/templates/bin/_apt.sh.tpl b/divingbell/templates/bin/_apt.sh.tpl index 981f3d6..8f700da 100644 --- a/divingbell/templates/bin/_apt.sh.tpl +++ b/divingbell/templates/bin/_apt.sh.tpl @@ -156,15 +156,12 @@ dpkg --configure -a apt-get autoremove -y {{- end }} -exit 0 +log.INFO 'Putting the daemon to sleep.' EOF chmod 755 {{ .Values.conf.chroot_mnt_path | quote }}/tmp/apt.sh chroot {{ .Values.conf.chroot_mnt_path | quote }} /tmp/apt.sh -sleep 1 -echo 'INFO Putting the daemon to sleep.' - while [ 1 ]; do sleep 300 done diff --git a/divingbell/templates/bin/_ethtool.sh.tpl b/divingbell/templates/bin/_ethtool.sh.tpl index 66e1c86..ff3286e 100644 --- a/divingbell/templates/bin/_ethtool.sh.tpl +++ b/divingbell/templates/bin/_ethtool.sh.tpl @@ -208,15 +208,12 @@ else log.WARN 'No ethtool overrides defined for this node.' fi -exit 0 +log.INFO 'Putting the daemon to sleep.' EOF chmod 755 {{ .Values.conf.chroot_mnt_path | quote }}/tmp/ethtool_host.sh chroot {{ .Values.conf.chroot_mnt_path | quote }} /tmp/ethtool_host.sh -sleep 1 -echo 'INFO Putting the daemon to sleep.' - while [ 1 ]; do sleep 300 done diff --git a/divingbell/templates/bin/_exec.sh.tpl b/divingbell/templates/bin/_exec.sh.tpl index bcbba24..ed78d10 100644 --- a/divingbell/templates/bin/_exec.sh.tpl +++ b/divingbell/templates/bin/_exec.sh.tpl @@ -211,14 +211,12 @@ UNIQUE_EOF_1840dbd4-09e1-4725-87f5-3b6944b80526 fi {{- end }} {{- end }} - +log.INFO 'Putting the daemon to sleep for {{ $exec_loop_sleep_interval }} seconds.' UNIQUE_EOF_9c341059-25a0-4725-9489-1789e255e381 chmod 700 {{ .Values.conf.chroot_mnt_path | quote }}/tmp/exec_host_{{ .Chart.Version }}.sh while true; do nsenter -t 1 -m -u -n -i -p /tmp/exec_host_{{ .Chart.Version }}.sh - sleep 2 - echo 'INFO Putting the daemon to sleep.' sleep {{ $exec_loop_sleep_interval }} done diff --git a/divingbell/templates/bin/_limits.sh.tpl b/divingbell/templates/bin/_limits.sh.tpl index 0776fdd..767a407 100644 --- a/divingbell/templates/bin/_limits.sh.tpl +++ b/divingbell/templates/bin/_limits.sh.tpl @@ -93,15 +93,12 @@ else log.WARN 'No limits overrides defined for this node.' fi -exit 0 +log.INFO 'Putting the daemon to sleep.' EOF chmod 755 {{ .Values.conf.chroot_mnt_path | quote }}/tmp/limits_host.sh chroot {{ .Values.conf.chroot_mnt_path | quote }} /tmp/limits_host.sh -sleep 1 -echo 'INFO Putting the daemon to sleep.' - while [ 1 ]; do sleep 300 done diff --git a/divingbell/templates/bin/_mounts.sh.tpl b/divingbell/templates/bin/_mounts.sh.tpl index dc4f7d4..c495dde 100644 --- a/divingbell/templates/bin/_mounts.sh.tpl +++ b/divingbell/templates/bin/_mounts.sh.tpl @@ -138,15 +138,12 @@ else log.WARN 'No mounts defined for this node.' fi -exit 0 +log.INFO 'Putting the daemon to sleep.' EOF chmod 755 {{ .Values.conf.chroot_mnt_path | quote }}/tmp/mounts_host.sh chroot {{ .Values.conf.chroot_mnt_path | quote }} /tmp/mounts_host.sh -sleep 1 -echo 'INFO Putting the daemon to sleep.' - while [ 1 ]; do sleep 300 done diff --git a/divingbell/templates/bin/_perm.sh.tpl b/divingbell/templates/bin/_perm.sh.tpl index f73f67e..ba6ebb8 100644 --- a/divingbell/templates/bin/_perm.sh.tpl +++ b/divingbell/templates/bin/_perm.sh.tpl @@ -197,16 +197,14 @@ if [[ $hash_check = pass ]] && [[ $interval_check = pass ]]; then fi echo 0 > "${hash}/exit_code" -exit 0 {{- end}} +log.INFO 'Putting the daemon to sleep for {{ $perm_loop_sleep_interval }} seconds.' EOF chmod 755 {{ .Values.conf.chroot_mnt_path | quote }}/tmp/perm_host.sh while true; do chroot {{ .Values.conf.chroot_mnt_path | quote }} /tmp/perm_host.sh - sleep 2 - echo 'INFO Putting the daemon to sleep.' sleep {{ $perm_loop_sleep_interval }} done diff --git a/divingbell/templates/bin/_sysctl.sh.tpl b/divingbell/templates/bin/_sysctl.sh.tpl index 43e3401..567951f 100644 --- a/divingbell/templates/bin/_sysctl.sh.tpl +++ b/divingbell/templates/bin/_sysctl.sh.tpl @@ -123,15 +123,12 @@ else log.WARN 'No sysctl overrides defined for this node.' fi -exit 0 +log.INFO 'Putting the daemon to sleep.' EOF chmod 755 {{ .Values.conf.chroot_mnt_path | quote }}/tmp/sysctl_host.sh chroot {{ .Values.conf.chroot_mnt_path | quote }} /tmp/sysctl_host.sh -sleep 1 -echo 'INFO Putting the daemon to sleep.' - while [ 1 ]; do sleep 300 done diff --git a/divingbell/templates/bin/_uamlite.sh.tpl b/divingbell/templates/bin/_uamlite.sh.tpl index af7b9f6..faf4337 100644 --- a/divingbell/templates/bin/_uamlite.sh.tpl +++ b/divingbell/templates/bin/_uamlite.sh.tpl @@ -230,15 +230,12 @@ else log.WARN 'No uamlite overrides defined for this node.' fi -exit 0 +log.INFO 'Putting the daemon to sleep.' EOF chmod 755 {{ .Values.conf.chroot_mnt_path | quote }}/tmp/uamlite_host.sh chroot {{ .Values.conf.chroot_mnt_path | quote }} /tmp/uamlite_host.sh -sleep 1 -echo 'INFO Putting the daemon to sleep.' - while [ 1 ]; do sleep 300 done diff --git a/tools/gate/scripts/020-test-divingbell.sh b/tools/gate/scripts/020-test-divingbell.sh index 58aec9b..c7cec1b 100755 --- a/tools/gate/scripts/020-test-divingbell.sh +++ b/tools/gate/scripts/020-test-divingbell.sh @@ -394,7 +394,7 @@ get_container_status(){ echo "${CLOGS}" exit 1 fi - elif [[ $(echo -e ${status} | tr -d '[:cntrl:]') = *'INFO Putting the daemon to sleep.'* ]] || + elif [[ $(echo -e ${status} | tr -d '[:cntrl:]') = *'INFO Putting the daemon to sleep'* ]] || [[ $(echo -e ${status} | tr -d '[:cntrl:]') = *'DEBUG + exit 0'* ]]; then if [ "${2}" = 'expect_failure' ]; then echo 'Expected pod to die with error, but pod completed successfully'