chiark / gitweb /
nspawn: add /dev FD symlinks in container setup
authorDave Reisner <dreisner@archlinux.org>
Wed, 15 Aug 2012 00:00:31 +0000 (20:00 -0400)
committerLennart Poettering <lennart@poettering.net>
Tue, 21 Aug 2012 15:19:38 +0000 (17:19 +0200)
This creates /dev/fd, /dev/stdin, /dev/stdout, /dev/stderr, and
/dev/core as symlinks to /proc on container creation. Except for
/dev/core, these are needed for shells like bash to be fully functional.

src/nspawn/nspawn.c

index 7d188f0712820f9c171bcce10b076590405a1ec3..40b99343d79c4fb2574fe52ba3b0a142b730de0a 100644 (file)
@@ -53,6 +53,7 @@
 #include "path-util.h"
 #include "loopback-setup.h"
 #include "sd-id128.h"
+#include "dev-setup.h"
 
 typedef enum LinkJournal {
         LINK_NO,
@@ -1204,6 +1205,8 @@ int main(int argc, char *argv[]) {
                 if (copy_devnodes(arg_directory) < 0)
                         goto child_fail;
 
+                dev_setup(arg_directory);
+
                 if (setup_dev_console(arg_directory, console) < 0)
                         goto child_fail;