Skip to content

Commit d45b8ee

Browse files
authored
Fix API stuck in updating state after API has crashed (#1691)
1 parent 1841774 commit d45b8ee

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkg/workloads/cortex/serve/init/bootloader.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,10 @@ create_s6_service() {
9595
# https://skarnet.org/software/s6/s6-svscanctl.html
9696
# http://skarnet.org/software/s6/s6-svc.html
9797
# http://skarnet.org/software/s6/servicedir.html
98+
99+
# good pages to read about execline
98100
# http://www.troubleshooters.com/linux/execline.htm
101+
# https://danyspin97.org/blog/getting-started-with-execline-scripting/
99102

100103
service_name=$1
101104
cmd=$2
@@ -110,7 +113,7 @@ create_s6_service() {
110113

111114
dest_script="$dest_dir/finish"
112115
echo "#!/usr/bin/execlineb -S0" > $dest_script
113-
echo "ifelse { s6-test \${1} -ne 0 } { s6-svscanctl -t /var/run/s6/services }" >> $dest_script
116+
echo "ifelse { s6-test \${1} -ne 0 } { foreground { redirfd -w 1 /var/run/s6/env-stage3/S6_STAGE2_EXITED s6-echo -n -- \${1} } s6-svscanctl -t /var/run/s6/services }" >> $dest_script
114117
echo "s6-svc -O /var/run/s6/services/$service_name" >> $dest_script
115118
chmod +x $dest_script
116119
}

0 commit comments

Comments
 (0)