This way if things crash, we don't leak mounts that need cleaning up.
---
 tools/catalyst-auto | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/tools/catalyst-auto b/tools/catalyst-auto
index c4c6aa6..c4796a1 100755
--- a/tools/catalyst-auto
+++ b/tools/catalyst-auto
@@ -1,5 +1,13 @@
 #!/bin/bash
 
+# First let's get our own mount namespace to avoid leaking crap.
+if [[ -z ${UNSHARE} ]] ; then
+  if type -P unshare >&/dev/null ; then
+    UNSHARE=true exec unshare -m -- "$0" "$@"
+  fi
+fi
+unset UNSHARE
+
 PID=$$
 
 config_file=
-- 
1.8.4.3


Reply via email to