[sandbox 3/3] Create /dev/fd symlink to /proc/self/fd

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Some applications and scripts are using /dev/fd. Netconfig and
openSUSE network scripts are in such a case, getting the symlink makes
them work.
---
 libvirt-sandbox/libvirt-sandbox-init-qemu.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libvirt-sandbox/libvirt-sandbox-init-qemu.c b/libvirt-sandbox/libvirt-sandbox-init-qemu.c
index cd6055a..5ecc3de 100644
--- a/libvirt-sandbox/libvirt-sandbox-init-qemu.c
+++ b/libvirt-sandbox/libvirt-sandbox-init-qemu.c
@@ -356,6 +356,12 @@ main(int argc ATTR_UNUSED, char **argv ATTR_UNUSED)
 
     /* Main special filesystems */
     mount_other("/dev", "devtmpfs", 0755);
+    if (symlink("/proc/self/fd", "/dev/fd") < 0) {
+        fprintf(stderr, "libvirt-sandbox-init-qemu: %s: failed to create /dev/fd symlink: %s\n",
+                __func__, strerror(errno));
+        exit_poweroff();
+    }
+
     mount_other_opts("/dev/pts", "devpts", "gid=5,mode=620,ptmxmode=000", 0755);
     mount_other("/sys", "sysfs", 0755);
     mount_other("/proc", "proc", 0755);
-- 
2.1.4

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]