<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Kommentare zu: Running a script with unshared mount namespace</title>
	<atom:link href="http://www.piware.de/2012/12/running-a-script-with-unshared-mount-namespace/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.piware.de/2012/12/running-a-script-with-unshared-mount-namespace/</link>
	<description>addicted to Free Software Development</description>
	<lastBuildDate>Mon, 06 May 2013 01:32:04 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>Von: Martin Pitt: Running a script with unshared mount namespace - Bartle Doo</title>
		<link>http://www.piware.de/2012/12/running-a-script-with-unshared-mount-namespace/comment-page-1/#comment-9403</link>
		<dc:creator>Martin Pitt: Running a script with unshared mount namespace - Bartle Doo</dc:creator>
		<pubDate>Mon, 17 Dec 2012 04:18:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.piware.de/?p=794#comment-9403</guid>
		<description>[...] Planet Ubuntu GD Star [...]</description>
		<content:encoded><![CDATA[<p>[...] Planet Ubuntu GD Star [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: Anonymous</title>
		<link>http://www.piware.de/2012/12/running-a-script-with-unshared-mount-namespace/comment-page-1/#comment-9402</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Sun, 16 Dec 2012 20:43:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.piware.de/?p=794#comment-9402</guid>
		<description>@Jeff, Colin: Note that either the environment variable or argument approach requires you to trust the caller.  Given that, what makes an environment variable preferred?</description>
		<content:encoded><![CDATA[<p>@Jeff, Colin: Note that either the environment variable or argument approach requires you to trust the caller.  Given that, what makes an environment variable preferred?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: Colin Watson</title>
		<link>http://www.piware.de/2012/12/running-a-script-with-unshared-mount-namespace/comment-page-1/#comment-9398</link>
		<dc:creator>Colin Watson</dc:creator>
		<pubDate>Sun, 16 Dec 2012 10:53:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.piware.de/?p=794#comment-9398</guid>
		<description>I agree with Jeff (#5): use an environment variable and self-re-exec.  See os-prober for an example of this.</description>
		<content:encoded><![CDATA[<p>I agree with Jeff (#5): use an environment variable and self-re-exec.  See os-prober for an example of this.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: Jeff Epler</title>
		<link>http://www.piware.de/2012/12/running-a-script-with-unshared-mount-namespace/comment-page-1/#comment-9397</link>
		<dc:creator>Jeff Epler</dc:creator>
		<pubDate>Sun, 16 Dec 2012 03:15:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.piware.de/?p=794#comment-9397</guid>
		<description>#3 has the right idea, but it would be even better if you could use some kind of environmental test instead of an explicit commandline item.  second best would be to communicate via the environment instead: exec env UNSHARED=yes unshare -m &quot;$0&quot; &quot;$@&quot;.

You can also pull this logic out to a script that is read via &quot;.&quot;, so instead of a repeated stanza it&#039;s just
 . run-unshared-please
if a qualified path if required.</description>
		<content:encoded><![CDATA[<p>#3 has the right idea, but it would be even better if you could use some kind of environmental test instead of an explicit commandline item.  second best would be to communicate via the environment instead: exec env UNSHARED=yes unshare -m &#8220;$0&#8243; &#8220;$@&#8221;.</p>
<p>You can also pull this logic out to a script that is read via &#8220;.&#8221;, so instead of a repeated stanza it&#8217;s just<br />
 . run-unshared-please<br />
if a qualified path if required.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: Anonymous</title>
		<link>http://www.piware.de/2012/12/running-a-script-with-unshared-mount-namespace/comment-page-1/#comment-9396</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Sun, 16 Dec 2012 00:37:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.piware.de/?p=794#comment-9396</guid>
		<description>Assuming you trust the calling process, this seems slightly less ugly than tail and sh -c:

#!/bin/sh
if [ &quot;$1&quot; != &quot;_unshared_&quot; ]; then
    exec unshare -m &quot;$0&quot; _unshared_ &quot;$@&quot;
else
    shift
fi
# rest of script</description>
		<content:encoded><![CDATA[<p>Assuming you trust the calling process, this seems slightly less ugly than tail and sh -c:</p>
<p>#!/bin/sh<br />
if [ "$1" != "_unshared_" ]; then<br />
    exec unshare -m &#8220;$0&#8243; _unshared_ &#8220;$@&#8221;<br />
else<br />
    shift<br />
fi<br />
# rest of script</p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: dp</title>
		<link>http://www.piware.de/2012/12/running-a-script-with-unshared-mount-namespace/comment-page-1/#comment-9395</link>
		<dc:creator>dp</dc:creator>
		<pubDate>Sat, 15 Dec 2012 22:46:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.piware.de/?p=794#comment-9395</guid>
		<description>You can avoid the hard coding of the starting lines number using
an hard coded comment, try replacing:
tail -n +7
with
sed -ne &#039;/^# unshared program start/,$p&#039;
or for more flexibility
awk &#039;/^# unshared program start/,/# unshared program end/&#039;</description>
		<content:encoded><![CDATA[<p>You can avoid the hard coding of the starting lines number using<br />
an hard coded comment, try replacing:<br />
tail -n +7<br />
with<br />
sed -ne &#8216;/^# unshared program start/,$p&#8217;<br />
or for more flexibility<br />
awk &#8216;/^# unshared program start/,/# unshared program end/&#8217;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: pitti</title>
		<link>http://www.piware.de/2012/12/running-a-script-with-unshared-mount-namespace/comment-page-1/#comment-9394</link>
		<dc:creator>pitti</dc:creator>
		<pubDate>Sat, 15 Dec 2012 21:08:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.piware.de/?p=794#comment-9394</guid>
		<description>Thanks, nice trick! The whole test suite of postgresql-common is perl, so it wouldn&#039;t matter at all for this. I just wish there would be a similar way with using /bin/sh.</description>
		<content:encoded><![CDATA[<p>Thanks, nice trick! The whole test suite of postgresql-common is perl, so it wouldn&#8217;t matter at all for this. I just wish there would be a similar way with using /bin/sh.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: Michael</title>
		<link>http://www.piware.de/2012/12/running-a-script-with-unshared-mount-namespace/comment-page-1/#comment-9393</link>
		<dc:creator>Michael</dc:creator>
		<pubDate>Sat, 15 Dec 2012 20:35:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.piware.de/?p=794#comment-9393</guid>
		<description>Would the following work?
  #!/usr/bin/perl -eexec &#039;unshare&#039;, &#039;-uim&#039;, &#039;sh&#039;, @ARGV</description>
		<content:encoded><![CDATA[<p>Would the following work?<br />
  #!/usr/bin/perl -eexec &#8216;unshare&#8217;, &#8216;-uim&#8217;, &#8216;sh&#8217;, @ARGV</p>
]]></content:encoded>
	</item>
</channel>
</rss>
