<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
In trying to think of events to boot my systems with upstart I stumbled
over the following problem. On one machine I have the X-font-server
(xfs) installed, but not on the other. Thus on one machine I can start
X only after xfs, but the other should not wait (there it does not
exists). I want to use the same scripts (in case you want to provide
the scripts for a distribution for example). So we need not only have
multiple events to start a script, but also conditional multiple
events. <br>
<br>
Would it make sense to implement something like the example below?<br>
<br>
xdm script:<br>
<font face="Courier New, Courier, monospace">start on (
filesystem.writable AND <br>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp; IFEXISTS xfs/stop AND <br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; </font><font face="Courier New, Courier, monospace">IFEXISTS</font><font
 face="Courier New, Courier, monospace"> hald/stop AND<br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; IFEXISTS netmount/stop )<br>
<br>
script <br>
&nbsp;&nbsp;&nbsp; ...<br>
&nbsp;&nbsp;&nbsp; /usr/bin/xdm<br>
&nbsp;&nbsp;&nbsp; ...<br>
end script<br>
</font><br>
<br>
The IFEXISTS keyword tells the script to only wait for a xfs/stop event
if xfs is known to upstart. Maybe the most simple&nbsp; way to do this is to
check if there is a script in /etc/event.d with the name xfs. Of course
the xfs script should only be installed in /etc/event.d when the xfs
package is installed.<br>
<br>
Other examples are:<br>
- nfs should wait for quota if it exists<br>
- gkrellmd should wait for lm_sensors if it exists<br>
- hald should wait for dns if it exists.<br>
<br>
Does this make sense, or is there an other simpler way of doing this?<br>
<br>
Paul<br>
<br>
PS for Gentoo-ers, this is know as 'after'<br>
<br>
</body>
</html>