[lxc-devel] [lxcfs/master] upstart: change how we decide to not run in a container

hallyn on Github lxc-bot at linuxcontainers.org
Mon Mar 21 05:14:56 UTC 2016


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 453 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20160321/a25724f4/attachment.bin>
-------------- next part --------------
From 458bfd993a4d5cf56965f546dceffa19fb9e838c Mon Sep 17 00:00:00 2001
From: Serge Hallyn <serge.hallyn at ubuntu.com>
Date: Sun, 20 Mar 2016 21:08:47 -0700
Subject: [PATCH] upstart: change how we decide to not run in a container

Otherwise lxcfs keeps lxc from hitting state 'started', which
in turn blocks reboot/shutdown.

Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>
---
 config/init/upstart/lxcfs.conf | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/config/init/upstart/lxcfs.conf b/config/init/upstart/lxcfs.conf
index 1252b2c..37aa475 100644
--- a/config/init/upstart/lxcfs.conf
+++ b/config/init/upstart/lxcfs.conf
@@ -1,14 +1,20 @@
 description "FUSE filesystem for LXC"
 author "Stéphane Graber <stgraber at ubuntu.com>"
 
-start on not-container and (starting lxc or runlevel [2345])
+start on starting lxc or starting lxd or runlevel [2345]
 stop on runlevel [06]
 
 respawn
 
+pre-start script
+    [ ! -e /run/container_type ] || { stop; exit 0; }
+end script
+
 exec /usr/bin/lxcfs /var/lib/lxcfs
 
 post-stop script
+    [ -e /run/container_type ] && exit
+
     # Cleanup in case of crash
     fusermount -u /var/lib/lxcfs 2> /dev/null || true
     [ -L /etc/mtab ] || \


More information about the lxc-devel mailing list