commit:     6b85d4288c9409f8870396b8026862463e732bf8
Author:     William Hubbs <w.d.hubbs <AT> gmail <DOT> com>
AuthorDate: Thu Nov 20 16:55:53 2014 +0000
Commit:     William Hubbs <williamh <AT> gentoo <DOT> org>
CommitDate: Thu Nov 20 17:07:14 2014 +0000
URL:        
http://sources.gentoo.org/gitweb/?p=proj/openrc.git;a=commit;h=6b85d428

devfs: optionally add missing symbolic links

If symbolic links for /dev/{fd,stdin,stdout,stderr,core} do not exist
once /dev is mounted, we should create them.

---
 init.d/devfs.in | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/init.d/devfs.in b/init.d/devfs.in
index bcdbdcd..5af68f9 100644
--- a/init.d/devfs.in
+++ b/init.d/devfs.in
@@ -69,7 +69,14 @@ seed_dev()
        # so udev can add its start-message to dmesg
        [ -c /dev/kmsg ] || mknod -m 660 /dev/kmsg c 1 11
 
-       # Mount required stuff as user may not have then in /etc/fstab
+       # extra symbolic links not provided by default
+       [ -e /dev/fd ] || ln -snf /proc/self/fd /dev/fd
+       [ -e /dev/stdin ] || ln -snf /proc/self/fd/0 /dev/stdin
+       [ -e /dev/stdout ] || ln -snf /proc/self/fd/1 /dev/stdout
+       [ -e /dev/stderr ] || ln -snf /proc/self/fd/2 /dev/stderr
+       [ -e /proc/kcore ] && ln -snf /proc/kcore /dev/core
+
+       # Mount required directories as user may not have them in /etc/fstab
        for x in \
                "mqueue /dev/mqueue 1777 ,nodev mqueue" \
                "devpts /dev/pts 0755 ,gid=5,mode=0620 devpts" \

Reply via email to