<?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"
	>
<channel>
	<title>Comments on: How to (and why) supervise forking processes</title>
	<atom:link href="http://www.netsplit.com/2007/12/07/how-to-and-why-supervise-forking-processes/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.netsplit.com/2007/12/07/how-to-and-why-supervise-forking-processes/</link>
	<description>Just another WordPress weblog</description>
	<pubDate>Mon, 08 Sep 2008 08:08:53 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
		<item>
		<title>By: Dafydd</title>
		<link>http://www.netsplit.com/2007/12/07/how-to-and-why-supervise-forking-processes/#comment-566</link>
		<dc:creator>Dafydd</dc:creator>
		<pubDate>Mon, 10 Dec 2007 20:06:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.netsplit.com/2007/12/07/how-to-and-why-supervise-forking-processes/#comment-566</guid>
		<description>Eww:

- It's fairly common for ptrace to be disabled for security purposes on server systems. 
- Service forked != service ready.
- Eww.

How does upstart decide whether to wait for one or two forks?

For services that connect to the system bus, why not just tell upstart what their D-Bus name is? When launching network manager, you know it's ready when org.freedesktop.NetworkManager appears. No upstream changes necessary.

Similarly, for services that listen on sockets, why not just tell upstart which port they listen on? The downside being that (as far as I know) you have to poll for this information.

Also: since daemon processes become children of init when the process group is orphaned, can't upstart just monitor what its children are and infer readiness from that?</description>
		<content:encoded><![CDATA[<p>Eww:</p>
<p>- It&#8217;s fairly common for ptrace to be disabled for security purposes on server systems.<br />
- Service forked != service ready.<br />
- Eww.</p>
<p>How does upstart decide whether to wait for one or two forks?</p>
<p>For services that connect to the system bus, why not just tell upstart what their D-Bus name is? When launching network manager, you know it&#8217;s ready when org.freedesktop.NetworkManager appears. No upstream changes necessary.</p>
<p>Similarly, for services that listen on sockets, why not just tell upstart which port they listen on? The downside being that (as far as I know) you have to poll for this information.</p>
<p>Also: since daemon processes become children of init when the process group is orphaned, can&#8217;t upstart just monitor what its children are and infer readiness from that?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: The Evil Blog &#187; Blog Archive &#187; Evilbuntu?</title>
		<link>http://www.netsplit.com/2007/12/07/how-to-and-why-supervise-forking-processes/#comment-555</link>
		<dc:creator>The Evil Blog &#187; Blog Archive &#187; Evilbuntu?</dc:creator>
		<pubDate>Sun, 09 Dec 2007 13:19:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.netsplit.com/2007/12/07/how-to-and-why-supervise-forking-processes/#comment-555</guid>
		<description>[...] a prominent Ubuntu developer: all daemons are our [...]</description>
		<content:encoded><![CDATA[<p>[...] a prominent Ubuntu developer: all daemons are our [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mildred</title>
		<link>http://www.netsplit.com/2007/12/07/how-to-and-why-supervise-forking-processes/#comment-553</link>
		<dc:creator>Mildred</dc:creator>
		<pubDate>Sun, 09 Dec 2007 08:15:43 +0000</pubDate>
		<guid isPermaLink="false">http://www.netsplit.com/2007/12/07/how-to-and-why-supervise-forking-processes/#comment-553</guid>
		<description>Maybe it could be possible to keep watching the process in all its forks and just stop watching any of them when they do exec ...

We could imagine for example a daemon that would fork for example when a request is made to it, and then it's the parent that would handle the request and dies letting the chile waiting for others requests.
Well it seems a little bit odd but I think it could be useful in some cases. Also because when we write the upstart script we don't know if the daemon forks once or twice.</description>
		<content:encoded><![CDATA[<p>Maybe it could be possible to keep watching the process in all its forks and just stop watching any of them when they do exec &#8230;</p>
<p>We could imagine for example a daemon that would fork for example when a request is made to it, and then it&#8217;s the parent that would handle the request and dies letting the chile waiting for others requests.<br />
Well it seems a little bit odd but I think it could be useful in some cases. Also because when we write the upstart script we don&#8217;t know if the daemon forks once or twice.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott James Remnant</title>
		<link>http://www.netsplit.com/2007/12/07/how-to-and-why-supervise-forking-processes/#comment-544</link>
		<dc:creator>Scott James Remnant</dc:creator>
		<pubDate>Sat, 08 Dec 2007 14:48:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.netsplit.com/2007/12/07/how-to-and-why-supervise-forking-processes/#comment-544</guid>
		<description>Note that the trace is removed as soon as we've seen the two (or one) forks, so it's only there for a very short amount of time.  As soon as Upstart believes the service is actually running, you can attach strace or gdb to it as normal.

(If you run the service under strace or gdb, you don't need the fork following since strace/gdb stay in the foreground and follow the forks of the daemon themselves.)</description>
		<content:encoded><![CDATA[<p>Note that the trace is removed as soon as we&#8217;ve seen the two (or one) forks, so it&#8217;s only there for a very short amount of time.  As soon as Upstart believes the service is actually running, you can attach strace or gdb to it as normal.</p>
<p>(If you run the service under strace or gdb, you don&#8217;t need the fork following since strace/gdb stay in the foreground and follow the forks of the daemon themselves.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://www.netsplit.com/2007/12/07/how-to-and-why-supervise-forking-processes/#comment-539</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Fri, 07 Dec 2007 22:48:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.netsplit.com/2007/12/07/how-to-and-why-supervise-forking-processes/#comment-539</guid>
		<description>Could upstart support PID files when a daemon already knows how to write them, and just use ptrace as a fallback for those that don't?</description>
		<content:encoded><![CDATA[<p>Could upstart support PID files when a daemon already knows how to write them, and just use ptrace as a fallback for those that don&#8217;t?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff Schroeder</title>
		<link>http://www.netsplit.com/2007/12/07/how-to-and-why-supervise-forking-processes/#comment-537</link>
		<dc:creator>Jeff Schroeder</dc:creator>
		<pubDate>Fri, 07 Dec 2007 20:00:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.netsplit.com/2007/12/07/how-to-and-why-supervise-forking-processes/#comment-537</guid>
		<description>@Joe, one of the biggest limitations of ptrace() is that you can not ptrace an already ptrace'd process... It will all go away once they merge utrace, but that is sometime in the future.

http://people.redhat.com/roland/utrace/</description>
		<content:encoded><![CDATA[<p>@Joe, one of the biggest limitations of ptrace() is that you can not ptrace an already ptrace&#8217;d process&#8230; It will all go away once they merge utrace, but that is sometime in the future.</p>
<p><a href="http://people.redhat.com/roland/utrace/" rel="nofollow">http://people.redhat.com/roland/utrace/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joe Shaw</title>
		<link>http://www.netsplit.com/2007/12/07/how-to-and-why-supervise-forking-processes/#comment-533</link>
		<dc:creator>Joe Shaw</dc:creator>
		<pubDate>Fri, 07 Dec 2007 14:11:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.netsplit.com/2007/12/07/how-to-and-why-supervise-forking-processes/#comment-533</guid>
		<description>Woo hoo!  I guessed right. :)

Can multiple process ptrace at the same time?  Ie, can you still run strace or gdb on those processes?</description>
		<content:encoded><![CDATA[<p>Woo hoo!  I guessed right. <img src='http://www.netsplit.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Can multiple process ptrace at the same time?  Ie, can you still run strace or gdb on those processes?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ross Burton</title>
		<link>http://www.netsplit.com/2007/12/07/how-to-and-why-supervise-forking-processes/#comment-530</link>
		<dc:creator>Ross Burton</dc:creator>
		<pubDate>Fri, 07 Dec 2007 12:10:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.netsplit.com/2007/12/07/how-to-and-why-supervise-forking-processes/#comment-530</guid>
		<description>I can't decide if that is twisted or genius. :)</description>
		<content:encoded><![CDATA[<p>I can&#8217;t decide if that is twisted or genius. <img src='http://www.netsplit.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
</channel>
</rss>
