/srv/irclogs.ubuntu.com/2006/12/19/#upstart.txt

_ionkeybuk: In http://upstart.ubuntu.com/wiki/ComplexEventConfig, it is said that and/or has higher precedence than until. Wouldn't that mean that 'from foo until frodo or from bar until bilbo' is equal to 'from foo until (frodo or (from bar until bilbo))'?12:34
Keybuk_ion: I dunno, I'm a bit fuzzy about how that works :p12:34
KeybukI wrote what seemed to be right, but I think it's wrong12:34
Keybukthat spec's still in drafting until I'm sure12:35
Keybukwhen it comes to precedence, I just remember that "division and multiplication beat subtraction and addition, for everything else, use parens"12:37
_ionI started writing a parser based on the draft using racc (a yacc-ish parser generator for ruby) and i noticed '(from foo until (frodo or (from bar until bilbo)))' in debug output, that's why i asked. :-) Of course i realize it's still a preliminary document.12:39
_ionBtw, have you considered using bison for parsing the config files? It would make defining and modifying the grammar quite easy, especially with the more complex rules.12:40
_ion(Hmm, have i already asked this before?)12:41
KeybukI originally used bison/yacc12:42
Keybukand the code it generated was huge, and difficult to get it to work right12:42
Keybukit was easier to just write the parser by hand12:42
Keybukit's not that large after all (just the cfg_next_token function, really)12:42
_ionOk.12:42
=== gbutler69 [n=gbutler6@pseudo220.jewels.com] has joined #upstart
gbutler69On Ubuntu 6.10 can one create a config that will cause Upstart to start/stop in.telnetd as needed (instead of running inetd/xinetd)?12:45
gbutler69Anyone?12:46
Keybuknot in 6.10, no; the upstart version there has no facility to replace inetd12:46
=== Seveas [n=seveas@ubuntu/member/seveas] has joined #upstart
_ionracc is quite nice, there's a backend class (written in C for speed) in the ruby standard library; the generated parser files don't contain extra crud, they just subclass Racc::Parser.12:49
_ionI'll try to get the graphviz thingy done some day. :-)12:51
gbutler69KeyBuk: Thanks....that's what I was looking for? Out of curiosity, when will this support exist (planned)?12:52
Keybukgbutler69: ubuntu 7.10, I would guess12:52
Keybukit's not planned for upstart 0.3, which is aimed for Ubuntu 7.0412:57
gbutler69KeyBuk: OK, thanks....01:01
Keybukthat's not to say it won't happen, if someone codes it01:02
Keybukof course01:02
gbutler69That was my next question....01:02
gbutler69Need a volunteer to work on that?01:02
Keybukpatches are always welcome01:03
gbutler69OK...I think I'll start taking a look at it....probably won't get to it much until after the Holiday though....:)01:03
KeybukI'm hoping to get some upstart hacking done over the holiday01:04
Keybukwill be my main chance to do it01:05
gbutler69Should "upstartd" just listen for connections in place of "inetd/xinetd" or should replacement "indetd" be create that is part of the "upstart" package and it triggers the "connection received on port XX" events?01:07
gbutler69Any vision for this yet?01:09
Keybuk(...vague gut feeling: pid #1 shouldn't have net connections :p)01:15
=== gbutler [n=gbutler@69-168-169-204.clvdoh.adelphia.net] has joined #upstart
=== j_ack_ [n=rudi@p508D9348.dip0.t-ipconnect.de] has joined #upstart
gbutlerIf I want to work on the "replace inetd functionality" for upstart, where should I begin documenting/proposing the how, why, and what?03:20
gbutlerI'd like to start work on the spec for Upstart handling "inetd" events/traffic. 03:30
gbutlerI can't seem to figure out the "Upstart Wiki" thing though. How does one go about editing/adding specifications to it?03:31
_ionThe wiki and the mailing list are good starting points.03:31
wasabi_I'm not totally sure it's worth replacing inetd.04:09
wasabi_I mean, honestly, inetd works fine.04:09
wasabi_Or xinetd, whichever one you want.04:09
wasabi_I doubt any of us want to tackle that complete code base (again)04:09
wasabi_Maybe scott just can't wait, though. =)04:10
gbutlerwasabi_: Yes, I agree. I created a "lauchpad" entry and a spec placeholder. For the "Rationale" I put a lot of questions which basically all equate to, "Do we REALLY want upstart to replace inetd/xinetd?"04:13
=== maro [n=mark@0x55511dab.adsl.cybercity.dk] has joined #upstart
gbutlerI figure it enough "Rationale" can be found, then maybe it's worth doing....but, as I sat trying to think of reasons, I couldn't come up with anything other than, "We'd like upstart to be the central place for Job Control".04:14
=== gbutler [n=gbutler@69-168-169-204.clvdoh.adelphia.net] has left #upstart []
=== Amaranth [n=travis@unaffiliated/amaranth] has joined #upstart
=== peeps [n=peeps@cpe-70-112-25-110.austin.res.rr.com] has joined #upstart
=== psibox [n=dreger@smart.physik.fu-berlin.de] has joined #upstart
=== ced_ [n=ced@n220246132035.netvigator.com] has joined #upstart
ced_hey09:50
ced_where can i find the upstart manual? man upstart does not return anything09:58
=== Md [i=md@freenode/staff/md] has joined #upstart
=== Keybuk [n=scott@syndicate.netsplit.com] has joined #upstart
=== j_ack [n=rudi@p508D9359.dip0.t-ipconnect.de] has joined #upstart
AlexExtremehmm05:22
AlexExtremeIMO inetd functionality shouldn't be added05:22
_ionWhy not?05:22
AlexExtremeit's a bit dangerous to have process 1 handling internet connections - if there was security flaw, it would be easy to bring down the system05:22
AlexExtremecorrect me if i'm wrong, though05:23
_ionSince when is process 1 going to handle network connections?05:23
AlexExtremeif inetd functionality is added...05:23
_ionIt's not as if it's going to be added to /sbin/init :-)05:23
_ioninit just launches stuff based on events.05:23
AlexExtremehmm05:23
AlexExtreme:P05:23
AlexExtreme<Keybuk> +(...vague gut feeling: pid #1 shouldn't have net connections :p) << Keybuk said the same ;)05:24
_ionI believe everybody has that feeling. :-)05:24
=== theCore [n=alex@ubuntu/member/theCore] has joined #upstart
=== juergbi [n=juerg@80-219-26-249.dclient.hispeed.ch] has joined #upstart
_ionkeybuk: 'on foo and bar'  will upstart accumulate received events that match, and change the goal to 'start' when foo_received & bar_received == true? Will the accumulation of those events then be stopped until the goal is 'stop' again?09:31
Keybukyes to the first part09:32
Keybukwhen "foo" occurs, that node in the graph will be TRUE09:33
Keybukand when "bar" occurs, that node in the graph will also be TRUE09:33
Keybukthe "and" parent node of both is TRUE only once both children are TRUE09:33
KeybukI'm not sure what the next bit suggests?09:33
_ionI mean:09:34
_ionon foo and bar09:34
_ionstop on quux09:34
_ionLet's 'foo', 'bar' are received, and then 'quux' is received.09:34
_ion+say09:34
Keybukright09:34
Keybukthe goal will be stop, job will be stopped09:34
Keybukthe complex tree will be TRUE, but won't be evaluated, so won't cause the goal to change yet09:35
_ionWhat i meant with the second question is that after the goal is set to stop, the state of 'on foo and bar' should be false again, until foo and bar are received again, right?09:35
Keybukno09:37
Keybukthe state is TRUE09:37
Keybukboth events have occurred, as prescribed09:37
_ionAll right.09:37
Keybukto explain why09:37
Keybukimagine foo is "fhs-filesystem-up"09:37
Keybukand bar is "network-up"09:37
Keybukand quux is "network-down"09:37
Keybukif the job is stopped when the network is down, you don't want to have to wait until the filesystem goes down and up as well09:38
Keybukyou just want it restarted when the network comes up09:38
Keybukthe way to cause the tree to be reset to FALSE is to use "untilo"09:39
Keybuk(foo and bar) until quux09:39
Keybuknow, when quux occurs, the other side of the tree is explicitly set to false09:39
Keybukfoo and bar both have to occur again09:39
_ionSo the boolean value of 'on fhs-filesystem-up and network-up' will be calculated when (and only when) either 'fhs-filesystem-up' or 'network-up' is received, and if it amounts to TRUE, the goal will be changed to start?09:40
Keybukyes09:41
_ionOk, now i understand it. :-)09:41
Keybukthe tree is evaluated upwards each time a node is changed09:41
_ionIs 'on fhs-filesystem-up and network-up' equivalent to 'start on fhs-filesystem-up and network-up'?09:44
Keybukerr?09:45
Keybukno09:45
=== che [n=bleh@redhat/che] has joined #upstart
_ionSorry, i don't see the difference. I've probably misinterpreted or misread something from the complex-event-config doc.09:49
Keybukthat would match an fhs-filesystem-up event with the arguments "and" & "network-up" ?09:49
_ionHmm.09:49
_ionHow to match something with the argument 'and' from an 'on' or 'until' expression? :-)09:50
Keybukwhat do you want to match09:51
Keybukdescribe the state09:51
_ionThat was just a hypothetical example. What i'm really thinking is making 'and' a reserved word  something that can't be matched  and changing the 'start on' expression to what is defined as 'on' in complex-event-config. Perhaps make it possible to match a reserved word as follows: start on foo "and" bar09:56
Keybukthe trouble is that the complex expression also defines when things stop09:57
Keybuknot just when they start09:57
Keybukso "start on network-up until network-down" makes no sense09:57
Keybukwhich is why we decided it was separate from start on/stop on09:57
_ionI thought it was "from network-up until network-down"09:57
Keybuklike I said, it makes no sense to allow that for start09:57
Keybukfrom/on are just syntactic sugar09:57
Keybuknetwork-up until network-down09:58
Keybuk(where until is the joining operator)09:58
Keybuknetwork-up until network-down and fhs-up until fhs-down09:58
Keybukblock-device-added and network-up until network-down09:58
Keybuk^ block device added while there's a network09:58
Keybukthe complex config is intended to be a discreet thing to start on/stop on09:59
Keybukwith the latter just "easy options"09:59
_ionOk, i see.10:00
Keybukmaybe it's not clear in the spec10:00
Keybukor maybe it just doesn't make sense for it to behave this way10:00
Keybukthe problem we wanted to avoid was this:10:01
Keybuk  start on network-up and fhs-filesystem-up10:01
Keybuk  stop on network-down and fhs-filesystem-down10:01
_ionSo basically 'on' and 'from' are just ignored, but they are necessary in the beginning of a line?10:01
Keybukon startup, both network-up and fhs-filesystem-up happen10:01
Keybukthen the network goes down, so network-down happens10:01
Keybuk(err, that latter should be "stop on network-down OR fhs-filesystem-down", sorry)10:02
Keybukso the job stops10:02
Keybukbut the "network-up and fhs-filesystem-up" bit is still TRUE (those events have both happened)10:02
Keybukso if you get fhs-filesystem-down followed by fhs-filesystem-up10:03
Keybukthe job will get started, despite the network not being up10:03
Keybukthat's what "until" is for10:03
Keybuk"network-up until network-down" explicitly states that the fact network-up has happened is forgotten once network-down happens10:03
Keybukand once you have that, you can't easily express that in terms of start or stop10:04
Keybukbecause it says both10:04
_ionThanks for explaining.10:11
Keybukdoes that make sense?10:11
Keybukis it crack?10:11
_ionI agree with almost everything, only the syntax could be a bit cleaner IMHO. I'd replace 'on' and 'from' with 'SOMESTANZA <expr>' where expr is a combination of '<event>', '<expr> and <expr>', '<expr> or <expr>', '<expr> until <expr>', 'with <job>'. Also 'with <job>' wouldn't be a valid line without the 'SOMESTANZA' in front of it.10:22
Keybukok10:24
Keybukwhat's a suitable SOMESTANZA?10:24
_ionStill thinking of that. :-)10:25
_ionIt should be short and self-descripting.10:25
Keybukthe language for that syntax has caused us issues :)  e.g. "and" behaves more an intersection10:26
Keybukwhere as "A until B and C until D" in English implies a union10:26
Keybukand the English "A until B or C until D" implies a difference :)10:27
_ionActually, 'on' *is* quite good, but IMHO it should not be allowed inside <expr>, and 'from' being an alias for it causes confusion.10:28
_ionI would change10:29
_ionfrom network-up until network-down10:29
_ionand from fhs-mounted until fhs-unmounted10:29
_ionto:10:29
_ionon network-up until network-down \10:30
_ion    and fhs-mounted until fhs-unmounted10:30
_ionOr instead of using a \ put the expression (after 'or') in parenthesis.10:30
_ionI mean after 'on'10:31
Keybukis 'from' not better than 'on' ?10:31
_ionI think there should only be one stanza, no aliases. I'm not sure whether it should be 'on' either. The syntax should allow any of the following:10:35
_ionFOO some-event10:35
_ionFOO network-up until network-down and fhs-mounted until fhs-unmounted10:35
_ionFOO with apache or with httpd10:35
Keybukand get rid of "stop on" entirely?10:35
_ion"start on <event>" and "stop on <event>" would still be there for simple event config, but "FOO <expression>" would be added for complex event config.10:36
_ionline : 'start on' EVENT | 'stop on' EVENT | 'FOO' expression | ... ;10:39
_ionexpression : EVENT | expression 'and' expression | expression 'or' expression | expression 'until' expression | with JOB | '(' expression ')' ;10:39
_ionOr something like that.10:39
Keybukok10:39
Keybukthat's pretty much what I was going for :)10:39
Keybukjust gotta pick a FOO10:40
Keybukand get rid of the on/from bit10:40
_ionWhoops, s/with/'with'/10:40
Keybukthe reason for allowing multiple 'on's was to allow:10:42
Keybuk  on foo and10:42
Keybuk  on bar10:42
Keybukwithout requiring10:42
Keybuk  on foo and \10:42
Keybuk  on bar10:42
Keybuk(ie. \ avoidance)10:42
_ionPerhaps ignore a newline after and/or/until/with?10:48
_ionFOO network-up until network-down and10:48
_ion    fhs-mounted until fhs-unmounted10:48
Keybukperhaps10:55
=== j_ack [n=rudi@p508D9359.dip0.t-ipconnect.de] has joined #upstart

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!