aboutsummaryrefslogtreecommitdiff
path: root/init.d/devfs.in
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2014-11-20 10:55:53 -0600
committerWilliam Hubbs <w.d.hubbs@gmail.com>2014-11-20 10:55:53 -0600
commit8d0ca13fbd38e782bae655eca6646dabc8d63899 (patch)
tree7074ac20b7cd07b0e7381cc45627142b9932a85f /init.d/devfs.in
parent93ba67eff9333e434c969bb8131467f777546764 (diff)
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.
Diffstat (limited to 'init.d/devfs.in')
-rw-r--r--init.d/devfs.in9
1 files changed, 8 insertions, 1 deletions
diff --git a/init.d/devfs.in b/init.d/devfs.in
index bcdbdcd4..5af68f91 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" \