[lxc-devel] [PATCH] Add a hook to make reboot sleep 0.5s (v2)

Serge Hallyn serge.hallyn at ubuntu.com
Thu Nov 12 20:33:33 UTC 2015


To ensure that the new container does not get cached directory entry
information from before we removed the container's cgroup using cgroupfs.

Changelog: make sure lxc.reboot.hook shows up in 'make dist'

Signed-off-by: Serge Hallyn <serge.hallyn at ubuntu.com>
---
 configure.ac             | 1 +
 share/00-lxcfs.conf.in   | 1 +
 share/Makefile.am        | 2 +-
 share/lxc.reboot.hook.in | 3 +++
 4 files changed, 6 insertions(+), 1 deletion(-)
 create mode 100755 share/lxc.reboot.hook.in

diff --git a/configure.ac b/configure.ac
index b0ff821..c0ab5ea 100644
--- a/configure.ac
+++ b/configure.ac
@@ -12,6 +12,7 @@ AC_CONFIG_FILES([
 	share/Makefile
 	share/00-lxcfs.conf
 	share/lxc.mount.hook
+	share/lxc.reboot.hook
 	tests/Makefile ])
 
 AM_INIT_AUTOMAKE
diff --git a/share/00-lxcfs.conf.in b/share/00-lxcfs.conf.in
index 640fb0a..5c88d47 100644
--- a/share/00-lxcfs.conf.in
+++ b/share/00-lxcfs.conf.in
@@ -1 +1,2 @@
 lxc.hook.mount = @LXCFSSHAREDIR@/lxc.mount.hook
+lxc.hook.post-stop = @LXCFSSHAREDIR@/lxc.reboot.hook
diff --git a/share/Makefile.am b/share/Makefile.am
index 0c568ee..64e43a9 100644
--- a/share/Makefile.am
+++ b/share/Makefile.am
@@ -1,5 +1,5 @@
 lxccommondir=@LXCCONFDIR@
 lxcfssharedir=@LXCFSSHAREDIR@
 
-lxcfsshare_SCRIPTS = lxc.mount.hook
+lxcfsshare_SCRIPTS = lxc.mount.hook lxc.reboot.hook
 lxccommon_DATA = 00-lxcfs.conf
diff --git a/share/lxc.reboot.hook.in b/share/lxc.reboot.hook.in
new file mode 100755
index 0000000..684fd3e
--- /dev/null
+++ b/share/lxc.reboot.hook.in
@@ -0,0 +1,3 @@
+#!/bin/sh -eu
+
+sleep 0.5s
-- 
2.5.0



More information about the lxc-devel mailing list