浏览代码

Some early fixes

Signed-off-by: Laurent Bercot <[email protected]>
Laurent Bercot 3 年之前
父节点
当前提交
e553a483ba

+ 3 - 2
layout/rootfs-overlay/init

@@ -13,14 +13,15 @@ addpath () {
   IFS=
   while test "$#" -gt 0 ; do
     if test "$1" = "$x" ; then
-      PATH="${x}:$PATH"
+      return
     fi
     shift
   done
+  PATH="${x}:$PATH"
 }
 
 if ! read PATH < /etc/s6-overlay/config/global_path ; then
-  PATH=
+  PATH=/bin
 fi
 
 addpath /bin

+ 7 - 2
layout/rootfs-overlay/package/admin/s6-overlay-@VERSION@/libexec/preinit

@@ -8,7 +8,8 @@
 
 prog=/package/admin/s6-overlay/libexec/preinit
 
-# Ensure /run is writable and /var/run is a symlink to it.
+
+# Ensure /run is writable
 
 if test "0$S6_READ_ONLY_ROOT" -ne 0 ; then
   echo "$prog: info: read-only root" 1>&2
@@ -28,12 +29,16 @@ else
   s6-mkdir -p -m 0755 /run
 fi
 
-if test -L /var/run && test "`/command/s6-linkname -f /var/run`" = /run ; then : ; else
+
+# Ensure /var/run is a symlink to /run
+
+if test -L /var/run && test "`s6-linkname -f /var/run`" = /run ; then : ; else
   echo "$prog: notice: /var/run is not a symlink to /run, fixing it" 1>&2
   s6-rmrf /var/run
   s6-ln -s /run /var/run
 fi
 
+
 # /run/s6 is recreated every time and belongs to the USER.
 
 s6-rmrf /run/s6