<?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: Upstart 0.5: Relationships</title>
	<atom:link href="http://www.netsplit.com/2008/05/01/upstart-05-relationships/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.netsplit.com/2008/05/01/upstart-05-relationships/</link>
	<description>Just another WordPress weblog</description>
	<pubDate>Sat, 05 Jul 2008 08:46:09 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
		<item>
		<title>By: MichaelC</title>
		<link>http://www.netsplit.com/2008/05/01/upstart-05-relationships/#comment-863</link>
		<dc:creator>MichaelC</dc:creator>
		<pubDate>Sun, 29 Jun 2008 20:18:14 +0000</pubDate>
		<guid isPermaLink="false">http://www.netsplit.com/?p=148#comment-863</guid>
		<description>I don't think you should jump through any hoops for portmap.  Your model is, if it's installed and not disabled, it runs.  Stick with that.  If nfs-client is installed and not disabled, then portmap needs to run.  If the distro doesn't want that to be the default, then it should either not install nfs-client by default or disable both nfs-client and portmap by default.  In the former case, installing nfs-client will automatically install portmap.  In the latter case, the distro is going to document how to enable nfs-client, so adding one more step to enable portmap isn't a stretch.

Two other random thoughts:

If you haven't already, I think you should consider the concept of job name aliases.  For example, needing an e-mail MTA isn't the same as tomcat needing apache.  I want to be able to say "start on started mailmta" so that my package doesn't have to be updated when a new MTA is added or the default MTA is changed.  You gave an example of doing that with an exported environment variable, but that seems kludgy to me.

You might want to consider "requires", "needs", or something similar as syntatic sugar for start on started, stop on stopping.  I know you didn't want to make it look like a dependency tree, but it's going to happen so often that something simpler may be warranted in this case.  Particularly since it's already been noted there could be confusion over starting, started, stopping, stopped.</description>
		<content:encoded><![CDATA[<p>I don&#8217;t think you should jump through any hoops for portmap.  Your model is, if it&#8217;s installed and not disabled, it runs.  Stick with that.  If nfs-client is installed and not disabled, then portmap needs to run.  If the distro doesn&#8217;t want that to be the default, then it should either not install nfs-client by default or disable both nfs-client and portmap by default.  In the former case, installing nfs-client will automatically install portmap.  In the latter case, the distro is going to document how to enable nfs-client, so adding one more step to enable portmap isn&#8217;t a stretch.</p>
<p>Two other random thoughts:</p>
<p>If you haven&#8217;t already, I think you should consider the concept of job name aliases.  For example, needing an e-mail MTA isn&#8217;t the same as tomcat needing apache.  I want to be able to say &#8220;start on started mailmta&#8221; so that my package doesn&#8217;t have to be updated when a new MTA is added or the default MTA is changed.  You gave an example of doing that with an exported environment variable, but that seems kludgy to me.</p>
<p>You might want to consider &#8220;requires&#8221;, &#8220;needs&#8221;, or something similar as syntatic sugar for start on started, stop on stopping.  I know you didn&#8217;t want to make it look like a dependency tree, but it&#8217;s going to happen so often that something simpler may be warranted in this case.  Particularly since it&#8217;s already been noted there could be confusion over starting, started, stopping, stopped.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JamesB</title>
		<link>http://www.netsplit.com/2008/05/01/upstart-05-relationships/#comment-851</link>
		<dc:creator>JamesB</dc:creator>
		<pubDate>Sun, 18 May 2008 18:33:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.netsplit.com/?p=148#comment-851</guid>
		<description>Hmm, no, I'll have to say that is *not* an elegant way to get portmap running.
Why? It means that install/uninstall of a daemon will mean altering other daemons.
That means clutter, and a disk that eventually looks like the Windows registry, with HKEY_CLASSES_ROOT full of garbage that can never go away.

No, the proper thing to do is keep all the information about what a daemon needs *with that daemon*.
It's not about "oh, it's so beautifully symmetric", it's about "it's maintainable, and I don't have things strewn across the disk that I will never find".
You should have 'start portmap on starting' for that case.

As to whether it's starting, I would suggest: shared library that parses and handles adding and removing these dependencies and queries them, and a tool that uses that library for command line users (or a graphical tool, either way, both would use the library). The former would be used by installers and the latter by end users. That way you can change the format, not worry about parsing, etc. Hmm, actually, if it was all done by a library the symmetry could probably be maintained if you wanted while being able to do proper uninstalls.

Biggest problem on *nix is users/scripts directly altering what should be private data structures. Should be via a library supplied with the tool that needs the data every time IMO...</description>
		<content:encoded><![CDATA[<p>Hmm, no, I&#8217;ll have to say that is *not* an elegant way to get portmap running.<br />
Why? It means that install/uninstall of a daemon will mean altering other daemons.<br />
That means clutter, and a disk that eventually looks like the Windows registry, with HKEY_CLASSES_ROOT full of garbage that can never go away.</p>
<p>No, the proper thing to do is keep all the information about what a daemon needs *with that daemon*.<br />
It&#8217;s not about &#8220;oh, it&#8217;s so beautifully symmetric&#8221;, it&#8217;s about &#8220;it&#8217;s maintainable, and I don&#8217;t have things strewn across the disk that I will never find&#8221;.<br />
You should have &#8217;start portmap on starting&#8217; for that case.</p>
<p>As to whether it&#8217;s starting, I would suggest: shared library that parses and handles adding and removing these dependencies and queries them, and a tool that uses that library for command line users (or a graphical tool, either way, both would use the library). The former would be used by installers and the latter by end users. That way you can change the format, not worry about parsing, etc. Hmm, actually, if it was all done by a library the symmetry could probably be maintained if you wanted while being able to do proper uninstalls.</p>
<p>Biggest problem on *nix is users/scripts directly altering what should be private data structures. Should be via a library supplied with the tool that needs the data every time IMO&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott James Remnant</title>
		<link>http://www.netsplit.com/2008/05/01/upstart-05-relationships/#comment-838</link>
		<dc:creator>Scott James Remnant</dc:creator>
		<pubDate>Thu, 01 May 2008 12:14:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.netsplit.com/?p=148#comment-838</guid>
		<description>@Frej: such relationships are entirely supported and unproblematic with Upstart.  If you were to "start A", then B would be started first.  If you were to "start B", then A would be started first.

There's no cyclic issues or graph resolution because there's no cycle or graph.  A is started, which emits the starting A event, which starts B.  B starting emits the starting B event, but that has no effect on A since it's already started.  B finishes starting, unblocking A, and allowing it to finish starting.

This is one of the elegancies of the event-based model.

Of course, there is one way to loop it, job A would have:
&lt;pre&gt;&lt;code&gt;
start on stopping B
stop on starting B
&lt;/code&gt;&lt;/pre&gt;

and job B would have:
&lt;pre&gt;&lt;code&gt;
start on stopping A
stop on starting A
&lt;/code&gt;&lt;/pre&gt;

Such a definition would create two jobs that flip-flopped between each other, but that's a perfectly valid service model -- one of "failover"</description>
		<content:encoded><![CDATA[<p>@Frej: such relationships are entirely supported and unproblematic with Upstart.  If you were to &#8220;start A&#8221;, then B would be started first.  If you were to &#8220;start B&#8221;, then A would be started first.</p>
<p>There&#8217;s no cyclic issues or graph resolution because there&#8217;s no cycle or graph.  A is started, which emits the starting A event, which starts B.  B starting emits the starting B event, but that has no effect on A since it&#8217;s already started.  B finishes starting, unblocking A, and allowing it to finish starting.</p>
<p>This is one of the elegancies of the event-based model.</p>
<p>Of course, there is one way to loop it, job A would have:</p>
<pre><code>
start on stopping B
stop on starting B
</code></pre>
<p>and job B would have:</p>
<pre><code>
start on stopping A
stop on starting A
</code></pre>
<p>Such a definition would create two jobs that flip-flopped between each other, but that&#8217;s a perfectly valid service model &#8212; one of &#8220;failover&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott James Remnant</title>
		<link>http://www.netsplit.com/2008/05/01/upstart-05-relationships/#comment-837</link>
		<dc:creator>Scott James Remnant</dc:creator>
		<pubDate>Thu, 01 May 2008 12:10:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.netsplit.com/?p=148#comment-837</guid>
		<description>Right, you'd need to keep the portmap job definition up to date for everything that started it.  In the tomcat case, that's actually just fine since you'd need to update the tomcat package for each web server it works with anyway -- but the portmap case it's a little pessimal.

Fortunately Upstart can do ordinary provision/requirement relationships, I just didn't want to document them in the blog because you should try to never use this kind of thing.

Remember that the job name is just one parameter to the "starting" event, there are others and you can add any additional ones you want with the "export" variable.

So our nfs-server job could add a parameter to its starting event:
&lt;pre&gt;&lt;code&gt;
env REQUIRE_PORTMAP=1
export REQUIRE_PORTMAP
&lt;/code&gt;&lt;/pre&gt;

That the portmap job could pick up and match:
&lt;pre&gt;&lt;code&gt;
start on starting REQUIRE_PORTMAP=1
&lt;/code&gt;&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Right, you&#8217;d need to keep the portmap job definition up to date for everything that started it.  In the tomcat case, that&#8217;s actually just fine since you&#8217;d need to update the tomcat package for each web server it works with anyway &#8212; but the portmap case it&#8217;s a little pessimal.</p>
<p>Fortunately Upstart can do ordinary provision/requirement relationships, I just didn&#8217;t want to document them in the blog because you should try to never use this kind of thing.</p>
<p>Remember that the job name is just one parameter to the &#8220;starting&#8221; event, there are others and you can add any additional ones you want with the &#8220;export&#8221; variable.</p>
<p>So our nfs-server job could add a parameter to its starting event:</p>
<pre><code>
env REQUIRE_PORTMAP=1
export REQUIRE_PORTMAP
</code></pre>
<p>That the portmap job could pick up and match:</p>
<pre><code>
start on starting REQUIRE_PORTMAP=1
</code></pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Frej Soya</title>
		<link>http://www.netsplit.com/2008/05/01/upstart-05-relationships/#comment-836</link>
		<dc:creator>Frej Soya</dc:creator>
		<pubDate>Thu, 01 May 2008 10:18:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.netsplit.com/?p=148#comment-836</guid>
		<description>Nice style of blog posts. 
I'm probably wrong but, doesn't this conflict? (seems obvious though, so i'm probably missing something...)
service A has:
start on starting B (A before B)
service B has
start on starting A (B before A)
Does upstart help with this? I'm not saying it should. It should be easy though, just keep the graph of services as a DAG. 

Minor nitpick - Semantic difference on start[ed&#124;ing] is a bit hard read. I know it is the current signal/event names. But explicitly denoting the difference of starting as "before", and started as "after"? Or maybe something else :)

start after dbus vs. start on starting dbus.
start before nfs-server vs. start on started nfs-server.
There might be other problems with this though, like not matching event names.

Make it easy to write/select the correct configuration - it would be nice. Very un*nix, but still nice ;)</description>
		<content:encoded><![CDATA[<p>Nice style of blog posts.<br />
I&#8217;m probably wrong but, doesn&#8217;t this conflict? (seems obvious though, so i&#8217;m probably missing something&#8230;)<br />
service A has:<br />
start on starting B (A before B)<br />
service B has<br />
start on starting A (B before A)<br />
Does upstart help with this? I&#8217;m not saying it should. It should be easy though, just keep the graph of services as a DAG. </p>
<p>Minor nitpick - Semantic difference on start[ed|ing] is a bit hard read. I know it is the current signal/event names. But explicitly denoting the difference of starting as &#8220;before&#8221;, and started as &#8220;after&#8221;? Or maybe something else <img src='http://www.netsplit.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>start after dbus vs. start on starting dbus.<br />
start before nfs-server vs. start on started nfs-server.<br />
There might be other problems with this though, like not matching event names.</p>
<p>Make it easy to write/select the correct configuration - it would be nice. Very un*nix, but still nice <img src='http://www.netsplit.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rudd-O</title>
		<link>http://www.netsplit.com/2008/05/01/upstart-05-relationships/#comment-835</link>
		<dc:creator>Rudd-O</dc:creator>
		<pubDate>Thu, 01 May 2008 07:02:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.netsplit.com/?p=148#comment-835</guid>
		<description>James, you stole the words from my mouth.  It seems this problem requires a dependency injection pattern.</description>
		<content:encoded><![CDATA[<p>James, you stole the words from my mouth.  It seems this problem requires a dependency injection pattern.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James Henstridge</title>
		<link>http://www.netsplit.com/2008/05/01/upstart-05-relationships/#comment-834</link>
		<dc:creator>James Henstridge</dc:creator>
		<pubDate>Thu, 01 May 2008 06:28:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.netsplit.com/?p=148#comment-834</guid>
		<description>If we assumed that SUN-RPC was still popular and people were writing new daemons that depended on portmap, wouldn't this require updating the portmap package every time a new daemon was added to the repository?

Perhaps an equivalent of the "provides:" package management directive would make sense here, so portmap could say "start on starting portmap-user" and have nfs-server say that it is a "portmap-user"?</description>
		<content:encoded><![CDATA[<p>If we assumed that SUN-RPC was still popular and people were writing new daemons that depended on portmap, wouldn&#8217;t this require updating the portmap package every time a new daemon was added to the repository?</p>
<p>Perhaps an equivalent of the &#8220;provides:&#8221; package management directive would make sense here, so portmap could say &#8220;start on starting portmap-user&#8221; and have nfs-server say that it is a &#8220;portmap-user&#8221;?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vadim P.</title>
		<link>http://www.netsplit.com/2008/05/01/upstart-05-relationships/#comment-828</link>
		<dc:creator>Vadim P.</dc:creator>
		<pubDate>Thu, 01 May 2008 03:30:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.netsplit.com/?p=148#comment-828</guid>
		<description>Sounds powerful. Does this system keep the same/better speed though?</description>
		<content:encoded><![CDATA[<p>Sounds powerful. Does this system keep the same/better speed though?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
