Complex-event-config changes

Johan Kiviniemi netsplit.com-upstart-devel at johan.kiviniemi.name
Wed Dec 20 23:04:50 GMT 2006


The syntax defined in the [1]complex-event-config spec could be simpler
to implement (from a programmer's point of view) and to understand (from
a user's point of view).

[1] http://upstart.ubuntu.com/wiki/ComplexEventConfig

As far as i've understood, the 'on' and 'from' keywords don't really do
anything, but they're needed in the beginning of a line.

I propose modifying the specified syntax as follows:
• Drop 'on' and 'from'.
• Don't allow 'with' to begin a line.
• Add a certain stanza that accepts a complex-event-config expression as
  a parameter.

I haven't been able to come up with a good (i.e. short and self-
describing) name for the stanza yet. Ideas are welcome. Let's call it
FOO for now. :-)

Using pseudo-yacc, the rules would be defined as:

precedence
  right 'with'
  left  'until'
  left  'and' 'or'

stanza : 'start' 'on' event
       | 'stop'  'on' event
       | 'FOO' cmplx_expr
  ...

cmplx_expr : event
           | cmplx_expr 'and'   cmplx_expr
           | cmplx_expr 'or'    cmplx_expr
           | cmplx_expr 'until' cmplx_expr
           | 'with' job
           | '(' cmplx_expr ')'
           ;

These rules are much simpler than what's currently described in the spec.

Usage examples:

FOO some-event
FOO some-event or some-other-event
FOO some-event and some-other-event

FOO network-up until network-down and
	fhs-mounted until fhs-unmounted

FOO with multiuser
FOO with apache or with httpd

FOO foo until frodo or bar until bilbo


Comments, criticism?

-- 
Jοhan Kiviniemi  http://johan.kiviniemi.name/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : https://lists.ubuntu.com/archives/upstart-devel/attachments/20061221/703594ed/attachment.pgp 


More information about the upstart-devel mailing list