<?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: That edgy chroot can go &#8230; oops!</title>
	<atom:link href="http://www.piware.de/2008/07/that-edgy-chroot-can-go-oops/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.piware.de/2008/07/that-edgy-chroot-can-go-oops/</link>
	<description>addicted to Ubuntu development</description>
	<lastBuildDate>Wed, 08 Feb 2012 11:00:26 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
	<item>
		<title>Von: foo</title>
		<link>http://www.piware.de/2008/07/that-edgy-chroot-can-go-oops/comment-page-1/#comment-112</link>
		<dc:creator>foo</dc:creator>
		<pubDate>Tue, 22 Jul 2008 07:11:08 +0000</pubDate>
		<guid isPermaLink="false">http://martinpitt.wordpress.com/?p=16#comment-112</guid>
		<description>Use schroot instead of wasting time with scripting. schroot rocks.</description>
		<content:encoded><![CDATA[<p>Use schroot instead of wasting time with scripting. schroot rocks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: Michael MacDonald</title>
		<link>http://www.piware.de/2008/07/that-edgy-chroot-can-go-oops/comment-page-1/#comment-111</link>
		<dc:creator>Michael MacDonald</dc:creator>
		<pubDate>Mon, 21 Jul 2008 19:38:56 +0000</pubDate>
		<guid isPermaLink="false">http://martinpitt.wordpress.com/?p=16#comment-111</guid>
		<description>It&#039;s not a foolproof way to handle it, but you could write a wrapper script to manage your chroot work.

I can&#039;t share my work scripts, but the logic goes something like this:

BIND_MOUNTS=/foo /bar /baz

for mount in $BIND_MOUNTS; do

done

sudo chroot $CHROOT

The trick is to create a rollback() function that un-does all the mounts, and then do something like this:

trap rollback INT
trap rollback TERM
trap rollback EXIT

That way, things get cleaned up on most exit conditions.  You can make your script pretty fancy, to avoid multiple mounts and do distro-specific stuff.  You can also use a ROLLBACK array, instead of hard-coding the cleanup process...  etc. etc.

Might be too much work for a one-off, but if you spend a lot of time inside chroots, it makes life a lot easier.</description>
		<content:encoded><![CDATA[<p>It&#8217;s not a foolproof way to handle it, but you could write a wrapper script to manage your chroot work.</p>
<p>I can&#8217;t share my work scripts, but the logic goes something like this:</p>
<p>BIND_MOUNTS=/foo /bar /baz</p>
<p>for mount in $BIND_MOUNTS; do</p>
<p>done</p>
<p>sudo chroot $CHROOT</p>
<p>The trick is to create a rollback() function that un-does all the mounts, and then do something like this:</p>
<p>trap rollback INT<br />
trap rollback TERM<br />
trap rollback EXIT</p>
<p>That way, things get cleaned up on most exit conditions.  You can make your script pretty fancy, to avoid multiple mounts and do distro-specific stuff.  You can also use a ROLLBACK array, instead of hard-coding the cleanup process&#8230;  etc. etc.</p>
<p>Might be too much work for a one-off, but if you spend a lot of time inside chroots, it makes life a lot easier.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: Rob J. Caskey</title>
		<link>http://www.piware.de/2008/07/that-edgy-chroot-can-go-oops/comment-page-1/#comment-110</link>
		<dc:creator>Rob J. Caskey</dc:creator>
		<pubDate>Mon, 21 Jul 2008 18:16:47 +0000</pubDate>
		<guid isPermaLink="false">http://martinpitt.wordpress.com/?p=16#comment-110</guid>
		<description>I have, in the past, rm -rf&#039;d /target, although fortunately is a fresh install w/ debootstrap, but still, yeah, been there.</description>
		<content:encoded><![CDATA[<p>I have, in the past, rm -rf&#8217;d /target, although fortunately is a fresh install w/ debootstrap, but still, yeah, been there.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: John Gill</title>
		<link>http://www.piware.de/2008/07/that-edgy-chroot-can-go-oops/comment-page-1/#comment-109</link>
		<dc:creator>John Gill</dc:creator>
		<pubDate>Mon, 21 Jul 2008 18:05:29 +0000</pubDate>
		<guid isPermaLink="false">http://martinpitt.wordpress.com/?p=16#comment-109</guid>
		<description>I would do:

  alias rid=&#039;rm --one-file-system&#039;

instead and then get into the habit of using rid.

aliasing standard commands like rm to a less dangerous version of themselves seems a great idea until you go onto a system that doesn&#039;t have the alias.</description>
		<content:encoded><![CDATA[<p>I would do:</p>
<p>  alias rid=&#8217;rm &#8211;one-file-system&#8217;</p>
<p>instead and then get into the habit of using rid.</p>
<p>aliasing standard commands like rm to a less dangerous version of themselves seems a great idea until you go onto a system that doesn&#8217;t have the alias.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

