Symlink cannot resemble /dev/kmsg semantics, so symlinking it is wrong.
Guests probably should not use /dev/kmsg at all.
Fixes journald crashes and journal corruption in systemd guests.
---
 src/lxc/conf.c | 30 ------------------------------
 1 file changed, 30 deletions(-)

diff --git a/src/lxc/conf.c b/src/lxc/conf.c
index 4f041dc..85d72c9 100644
--- a/src/lxc/conf.c
+++ b/src/lxc/conf.c
@@ -1313,33 +1313,6 @@ static int setup_console(const struct lxc_rootfs *rootfs,
        return setup_ttydir_console(rootfs, console, ttydir);
 }
 
-static int setup_kmsg(const struct lxc_rootfs *rootfs,
-                      const struct lxc_console *console)
-{
-       char kpath[MAXPATHLEN];
-       int ret;
-
-       if (!rootfs->path)
-               return 0;
-       ret = snprintf(kpath, sizeof(kpath), "%s/dev/kmsg", rootfs->mount);
-       if (ret < 0 || ret >= sizeof(kpath))
-               return -1;
-
-       ret = unlink(kpath);
-       if (ret && errno != ENOENT) {
-               SYSERROR("error unlinking %s\n", kpath);
-               return -1;
-       }
-
-       ret = symlink("console", kpath);
-       if (ret) {
-               SYSERROR("failed to create symlink for kmsg");
-               return -1;
-       }
-
-       return 0;
-}
-
 int setup_cgroup(const char *name, struct lxc_list *cgroups)
 {
        struct lxc_list *iterator;
@@ -2566,9 +2539,6 @@ int lxc_setup(const char *name, struct lxc_conf *lxc_conf)
                return -1;
        }
 
-       if (setup_kmsg(&lxc_conf->rootfs, &lxc_conf->console))  // don't fail
-               ERROR("failed to setup kmsg for '%s'", name);
-
        if (setup_tty(&lxc_conf->rootfs, &lxc_conf->tty_info, 
lxc_conf->ttydir)) {
                ERROR("failed to setup the ttys for '%s'", name);
                return -1;
-- 
1.8.1


------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_123012
_______________________________________________
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel

Reply via email to