public inbox for gentoo-releng@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-releng] [PATCH] catalyst-auto: run in a mount namespace
@ 2014-01-22  5:59 Mike Frysinger
  0 siblings, 0 replies; only message in thread
From: Mike Frysinger @ 2014-01-22  5:59 UTC (permalink / raw
  To: gentoo-releng

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



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2014-01-22  5:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-22  5:59 [gentoo-releng] [PATCH] catalyst-auto: run in a mount namespace Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox