perm: ensure subprocess gets killed in perm script
Rarely, the child process create from exec line doesn't die when the main script ends. Ensure it gets killed. Change-Id: Ic2e1de9a1a6eeb55fc8eda39201976180f29a7f9
This commit is contained in:
parent
b22dd131dd
commit
d462a29d1f
@ -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
|
||||
|
@ -74,6 +74,8 @@ exec >& >(while read line; do
|
||||
fi
|
||||
done)
|
||||
|
||||
SUB_PID=$!
|
||||
|
||||
die(){
|
||||
# write to stderr any passed error message
|
||||
if [[ $@ = *[!\ ]* ]]; then
|
||||
|
Loading…
x
Reference in New Issue
Block a user