[lxc-devel] [lxc/master] create symlink for /var/run

mgariepy on Github lxc-bot at linuxcontainers.org
Tue Nov 8 16:43:14 UTC 2016


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 418 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20161108/823592d0/attachment.bin>
-------------- next part --------------
From d4377d5a2bcda9e576f4a88f4c79a56821e30f79 Mon Sep 17 00:00:00 2001
From: mgariepy <mgariepy at users.noreply.github.com>
Date: Tue, 8 Nov 2016 11:42:34 -0500
Subject: [PATCH] create symlink for /var/run

this patch create /var/run link to point to /run.

This will fix various issue present when /var/run is persistent.
---
 templates/lxc-centos.in | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/templates/lxc-centos.in b/templates/lxc-centos.in
index 2c444e4..8bd85a2 100644
--- a/templates/lxc-centos.in
+++ b/templates/lxc-centos.in
@@ -451,6 +451,13 @@ EOF
 
     $YUM install $PKG_LIST
 
+    # create symlink for /var/run -> ../run 
+    if [ "$release" = "7" ]; then
+        mv $INSTALL_ROOT/var/run/* $INSTALL_ROOT/run/
+        rmdir $INSTALL_ROOT/var/run
+        ln -sf ../run $INSTALL_ROOT/var/run
+    fi
+
     if [ $? -ne 0 ]; then
         echo "Failed to download the rootfs, aborting."
         return 1


More information about the lxc-devel mailing list