浏览代码

Fix documentation, wait for Docker notif, fix gracetime bug

Signed-off-by: Laurent Bercot <[email protected]>
Laurent Bercot 2 年之前
父节点
当前提交
791d0ac6a0
共有 3 个文件被更改,包括 10 次插入2 次删除
  1. 1 1
      README.md
  2. 8 0
      layout/rootfs-overlay/init
  3. 1 1
      layout/rootfs-overlay/package/admin/s6-overlay-@VERSION@/libexec/stage0

+ 1 - 1
README.md

@@ -563,7 +563,7 @@ from that only brings down the service when it exits nonzero:
 `/etc/services.d/myapp/finish`:
 ```
 #!/command/execlineb -S1
-if { s6-test ${1} -ne 0 -a ${1} -ne 256 }
+if { eltest ${1} -ne 0 -a ${1} -ne 256 }
 /run/s6/basedir/bin/halt
 ```
 

+ 8 - 0
layout/rootfs-overlay/init

@@ -29,6 +29,14 @@ addpath /usr/bin
 addpath /command
 export PATH
 
+
+# Wait for the Docker readiness notification, if any
+
+if read _ 2>/dev/null <&3 ; then
+  exec 3<&-
+fi
+
+
 # Now we're good: s6-overlay-suexec is accessible via PATH, as are
 # all our binaries.
 # Run preinit as root, then run stage0 as the container's user (can be

+ 1 - 1
layout/rootfs-overlay/package/admin/s6-overlay-@VERSION@/libexec/stage0

@@ -52,7 +52,7 @@ else
   loguseropt=''
 fi
 
-if test "0$S6_KILL_GRACETIME" -ne 0 ; then
+if eltest "$S6_KILL_GRACETIME" =~ '^[[:digit:]]+$' ; then
   graceopt="-q $S6_KILL_GRACETIME"
 else
   graceopt=''