diff --git a/divingbell/templates/bin/_perm.sh.tpl b/divingbell/templates/bin/_perm.sh.tpl index 444ef48..cec2fe3 100644 --- a/divingbell/templates/bin/_perm.sh.tpl +++ b/divingbell/templates/bin/_perm.sh.tpl @@ -211,6 +211,11 @@ fi echo 0 > "${hash}/exit_code" {{- end}} log.INFO 'Putting the daemon to sleep for {{ $perm_loop_sleep_interval }} seconds.' + +# Slight sleep to ensure the last log entry gets processed, then ensure the subprocess +# that's formatting entries is killed. +sleep 1 +kill $SUB_PID EOF chmod 755 {{ .Values.conf.chroot_mnt_path | quote }}/tmp/perm_host.sh diff --git a/divingbell/templates/bin/_shcommon.tpl b/divingbell/templates/bin/_shcommon.tpl index 95636e4..341c09c 100644 --- a/divingbell/templates/bin/_shcommon.tpl +++ b/divingbell/templates/bin/_shcommon.tpl @@ -74,6 +74,8 @@ exec >& >(while read line; do fi done) +SUB_PID=$! + die(){ # write to stderr any passed error message if [[ $@ = *[!\ ]* ]]; then